diff --git a/org/html_writer.go b/org/html_writer.go index 5f388d9..28c402c 100644 --- a/org/html_writer.go +++ b/org/html_writer.go @@ -100,7 +100,17 @@ func (w *HTMLWriter) Before(d *Document) { if title := d.Get("TITLE"); title != "" && w.document.GetOption("title") != "nil" { titleDocument := d.Parse(strings.NewReader(title), d.Path) if titleDocument.Error == nil { - title = w.WriteNodesAsString(titleDocument.Nodes...) + simpleTitle := false + if len(titleDocument.Nodes) == 1 { + switch p := titleDocument.Nodes[0].(type) { + case Paragraph: + simpleTitle = true + title = w.WriteNodesAsString(p.Children...) + } + } + if !simpleTitle { + title = w.WriteNodesAsString(titleDocument.Nodes...) + } } w.WriteString(fmt.Sprintf(`

%s

`+"\n", title)) } diff --git a/org/testdata/misc.html b/org/testdata/misc.html index 40c8e00..8043e23 100644 --- a/org/testdata/misc.html +++ b/org/testdata/misc.html @@ -1,5 +1,4 @@ -

Misc title with an inline html export

-

+

Misc title with an inline html export