Add support for #+HTML

This commit is contained in:
Niklas Fasching 2018-12-11 20:45:37 +01:00
parent 0a905ca172
commit ffe06b50f2
4 changed files with 31 additions and 3 deletions

View file

@ -63,7 +63,9 @@ func (w *HTMLWriter) after(d *Document) {
func (w *HTMLWriter) writeNodes(ns ...Node) {
for _, n := range ns {
switch n := n.(type) {
case Keyword, Comment:
case Keyword:
w.writeKeyword(n)
case Comment:
continue
case NodeWithMeta:
w.writeNodeWithMeta(n)
@ -142,6 +144,12 @@ func (w *HTMLWriter) writeBlock(b Block) {
}
}
func (w *HTMLWriter) writeKeyword(k Keyword) {
if k.Key == "HTML" {
w.WriteString(k.Value + "\n")
}
}
func (w *HTMLWriter) writeFootnoteDefinition(f FootnoteDefinition) {
n := f.Name
w.WriteString(`<div class="footnote-definition">` + "\n")