HTML export: Export src block language as css class

Org mode exports source blocks with the language as a css-class of the exported
source block - it's easy enough to do the same.
This commit is contained in:
Niklas Fasching 2019-07-07 10:19:24 +02:00
parent f1a747ad72
commit 37d33c1206
8 changed files with 30 additions and 2 deletions

View file

@ -108,7 +108,8 @@ func (w *HTMLWriter) WriteBlock(b Block) {
if len(b.Parameters) >= 1 {
lang = strings.ToLower(b.Parameters[0])
}
w.WriteString(w.HighlightCodeBlock(content, lang) + "\n")
content = w.HighlightCodeBlock(content, lang)
w.WriteString(fmt.Sprintf("<pre class=\"src src-%s\">\n%s\n</pre>\n", lang, content))
case name == "EXAMPLE":
w.WriteString(`<pre class="example">` + "\n" + content + "\n</pre>\n")
case name == "EXPORT" && len(b.Parameters) >= 1 && strings.ToLower(b.Parameters[0]) == "html":