ox-html: Fix invalid syntax in html attributes
* lisp/ox-html.el (org-html--build-meta-info): Fix invalid characters in html attributes.
This commit is contained in:
parent
f6d7230ca2
commit
4c812675d0
|
@ -1421,10 +1421,20 @@ INFO is a plist used as a communication channel."
|
||||||
(defun org-html--build-meta-info (info)
|
(defun org-html--build-meta-info (info)
|
||||||
"Return meta tags for exported document.
|
"Return meta tags for exported document.
|
||||||
INFO is a plist used as a communication channel."
|
INFO is a plist used as a communication channel."
|
||||||
(let* ((title (org-export-data (plist-get info :title) info))
|
(let ((protect-string
|
||||||
|
(lambda (str)
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"\"" """ (org-html-encode-plain-text str))))
|
||||||
|
(title (org-export-data (plist-get info :title) info))
|
||||||
(author (and (plist-get info :with-author)
|
(author (and (plist-get info :with-author)
|
||||||
(let ((auth (plist-get info :author)))
|
(let ((auth (plist-get info :author)))
|
||||||
(and auth (org-export-data auth info)))))
|
(and auth
|
||||||
|
;; Return raw Org syntax, skipping non
|
||||||
|
;; exportable objects.
|
||||||
|
(org-element-interpret-data
|
||||||
|
(org-element-map auth
|
||||||
|
(cons 'plain-text org-element-all-objects)
|
||||||
|
'identity info))))))
|
||||||
(description (plist-get info :description))
|
(description (plist-get info :description))
|
||||||
(keywords (plist-get info :keywords)))
|
(keywords (plist-get info :keywords)))
|
||||||
(concat
|
(concat
|
||||||
|
@ -1440,11 +1450,15 @@ INFO is a plist used as a communication channel."
|
||||||
(coding-system-get org-html-coding-system 'mime-charset))
|
(coding-system-get org-html-coding-system 'mime-charset))
|
||||||
"iso-8859-1"))
|
"iso-8859-1"))
|
||||||
(format "<meta name=\"generator\" content=\"Org-mode\"/>\n")
|
(format "<meta name=\"generator\" content=\"Org-mode\"/>\n")
|
||||||
(and author (format "<meta name=\"author\" content=\"%s\"/>\n" author))
|
(and (org-string-nw-p author)
|
||||||
(and description
|
(format "<meta name=\"author\" content=\"%s\"/>\n"
|
||||||
(format "<meta name=\"description\" content=\"%s\"/>\n" description))
|
(funcall protect-string author)))
|
||||||
(and keywords
|
(and (org-string-nw-p description)
|
||||||
(format "<meta name=\"keywords\" content=\"%s\"/>\n" keywords)))))
|
(format "<meta name=\"description\" content=\"%s\"/>\n"
|
||||||
|
(funcall protect-string description)))
|
||||||
|
(and (org-string-nw-p keywords)
|
||||||
|
(format "<meta name=\"keywords\" content=\"%s\"/>\n"
|
||||||
|
(funcall protect-string keywords))))))
|
||||||
|
|
||||||
(defun org-html--build-head (info)
|
(defun org-html--build-head (info)
|
||||||
"Return information for the <head>..</head> of the HTML output.
|
"Return information for the <head>..</head> of the HTML output.
|
||||||
|
|
Loading…
Reference in New Issue