소스 검색

ox-html.el: Add lang attribute to html tag

* lisp/ox-html.el (org-html-template): Add lang attribute to exported
  html tag.  Some features of the CSS Text Module (Level 3) require this
  attribute to be present (for example, so that the browser knows how to
  hyphenate the text). For more info, please take a look here:
  https://drafts.csswg.org/css-text-3/#languages

TINYCHANGE
Ruben Maher 10 년 전
부모
커밋
6b2c38bb71
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      lisp/ox-html.el

+ 6 - 4
lisp/ox-html.el

@@ -1911,10 +1911,12 @@ holding export options."
    (org-html-doctype info)
    "\n"
    (concat "<html"
-	   (when (org-html-xhtml-p info)
-	     (format
-	      " xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\""
-	      (plist-get info :language) (plist-get info :language)))
+	   (cond ((org-html-xhtml-p info)
+		  (format
+		   " xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\""
+		   (plist-get info :language) (plist-get info :language)))
+		 ((org-html-html5-p info)
+		  (format " lang=\"%s\"" (plist-get info :language))))
 	   ">\n")
    "<head>\n"
    (org-html--build-meta-info info)