emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ruben Maher <r@rkm.id.au>
To: emacs-orgmode@gnu.org
Cc: Ruben Maher <r@rkm.id.au>
Subject: [PATCH] ox-html.el: Add lang attribute to html tag
Date: Mon, 30 Nov 2015 16:57:27 +1030	[thread overview]
Message-ID: <1448864847-18790-1-git-send-email-r@rkm.id.au> (raw)

* 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
---
 lisp/ox-html.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index effd387..074cced 100644
--- a/lisp/ox-html.el
+++ b/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)
-- 
2.6.2

             reply	other threads:[~2015-11-30  6:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30  6:27 Ruben Maher [this message]
2015-11-30 21:07 ` [PATCH] ox-html.el: Add lang attribute to html tag Ruben Maher
2015-11-30 21:07   ` Ruben Maher
2015-12-01 22:37     ` Nicolas Goaziou
2015-12-02  6:03       ` Ruben Maher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448864847-18790-1-git-send-email-r@rkm.id.au \
    --to=r@rkm.id.au \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).