diff --git a/org/html.go b/org/html.go index 9c47dd0..70f4f40 100644 --- a/org/html.go +++ b/org/html.go @@ -34,7 +34,7 @@ var listTags = map[string][]string{ func NewHTMLWriter() *HTMLWriter { return &HTMLWriter{ HighlightCodeBlock: func(source, lang string) string { - return fmt.Sprintf("
%s", html.EscapeString(source)) + return fmt.Sprintf(`
%s
`, lang) + "\n")
- w.WriteString(w.HighlightCodeBlock(strings.Join(lines, "\n"), lang))
- w.WriteString("\n
\n")
+ w.WriteString(w.HighlightCodeBlock(strings.Join(lines, "\n"), lang) + "\n")
case "EXAMPLE":
w.WriteString(`\n`) w.writeNodes(b.Children...) diff --git a/org/testdata/example.html b/org/testdata/example.html index ea6c340..59aa612 100644 --- a/org/testdata/example.html +++ b/org/testdata/example.html @@ -63,9 +63,7 @@ and some lines of textand another subitem
--
+echo with a block-echo with a block
@@ -166,14 +164,10 @@ auto link, i.e. not inside \[[square brackets]\]
<
-echo a bash source block
-
-
-a source block without a language
+echo a bash source block
+a source block without a language
and a second line
-and a third one
-
+and a third one
\nan example block
with multiple lines
@@ -280,9 +274,7 @@ and other elements
like blocks
-
-other non-plain
-
+other non-plain