Merge pull request #211 from vatai/master

Add attributes to the <code> tag
This commit is contained in:
Yujie Wen 2016-06-21 17:59:01 +08:00 committed by GitHub
commit 8ca4e8745b
1 changed files with 4 additions and 2 deletions

View File

@ -923,6 +923,8 @@ contextual information."
#'buffer-substring))
(org-html-format-code src-block info))))
(frag (org-export-read-attribute :attr_reveal src-block :frag))
(code-attribs (or (org-export-read-attribute
:attr_reveal src-block :code_attribs) ""))
(label (let ((lbl (org-element-property :name src-block)))
(if (not lbl) ""
(format " id=\"%s\"" lbl)))))
@ -937,9 +939,9 @@ contextual information."
(format "<label class=\"org-src-name\">%s</label>"
(org-export-data caption info)))
(if use-highlight
(format "\n<pre%s%s><code class=\"%s\">%s</code></pre>"
(format "\n<pre%s%s><code class=\"%s\" %s>%s</code></pre>"
(or (frag-class frag info) "")
label lang code)
label lang code-attribs code)
(format "\n<pre %s%s>%s</pre>"
(or (frag-class frag info)
(format " class=\"src src-%s\"" lang))