diff --git a/README.org b/README.org index 1736d2c..8d24ee4 100644 --- a/README.org +++ b/README.org @@ -7,10 +7,8 @@ A basic org-mode parser in go *** TODO [[https://github.com/chaseadamsio/goorgeous/issues/46][#46]]: Support for symbols like ndash and mdash - see org-entities replacement: see org-entities-help *** TODO [[https://github.com/chaseadamsio/goorgeous/issues/10][#10]]: Support noexport -*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/19][#19]]: Support #+HTML *** TODO [[https://github.com/chaseadamsio/goorgeous/issues/31][#31]]: Support #+INCLUDE - see https://orgmode.org/manual/Include-files.html -*** TODO [[https://github.com/chaseadamsio/goorgeous/issues/33][#33]]: Wrong output when mixing html with org-mode * later - hugo frontmatter - see https://gohugo.io/content-management/front-matter/ -> actually seems to be handled by hugo itself - handle #+RESULTS: raw and stuff diff --git a/org/html.go b/org/html.go index 86e043a..8b212ca 100644 --- a/org/html.go +++ b/org/html.go @@ -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(`
neato!
@@ -13,6 +15,19 @@ or even a totally custom kind of block crazy ain't it?
foo | foo | +
bar | bar | +
code
wrapped text gets joined
either this
or that
foo.
diff --git a/org/testdata/misc.org b/org/testdata/misc.org
index 8629bf2..95a248a 100644
--- a/org/testdata/misc.org
+++ b/org/testdata/misc.org
@@ -1,4 +1,6 @@
** issues from goorgeous (free test cases, yay!)
+*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/19][#19]]: Support #+HTML
+#+HTML:
neato!
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/29][#29:]] Support verse block #+BEGIN_VERSE This @@ -10,6 +12,11 @@ verse or even a *totally* /custom/ kind of block crazy ain't it? #+END_CUSTOM +*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/33][#33]]: Wrong output when mixing html with org-mode +#+HTML: