diff --git a/main.go b/main.go index 22e229b..0c1f8df 100644 --- a/main.go +++ b/main.go @@ -50,5 +50,5 @@ func highlightCodeBlock(source, lang string) string { l = chroma.Coalesce(l) it, _ := l.Tokenise(nil, source) _ = html.New().Format(&w, styles.Get("friendly"), it) - return `
` + w.String() + `
` + return `
` + "\n" + w.String() + "\n" + `
` } diff --git a/org/html.go b/org/html.go index c64ee21..30aa1c1 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
%s
%s
`, "\n", html.EscapeString(source), "\n") }, } } diff --git a/org/testdata/blocks.html b/org/testdata/blocks.html index 7b31dba..a86d2f7 100644 --- a/org/testdata/blocks.html +++ b/org/testdata/blocks.html @@ -1,12 +1,16 @@
-
echo a bash source block
+
+
echo a bash source block
+

block!

-
a source block without a language
+
+
a source block without a language
 and a second line
-and a third one
+and a third one
+
 an example block
 with multiple lines
diff --git a/org/testdata/captions.html b/org/testdata/captions.html
index f4b068c..b42b6bc 100644
--- a/org/testdata/captions.html
+++ b/org/testdata/captions.html
@@ -2,7 +2,9 @@
 Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div)
 

-
echo "i have a caption!"
+
+
echo "i have a caption!"
+

captioned soure block

diff --git a/org/testdata/footnotes.html b/org/testdata/footnotes.html index e7991a9..8d22415 100644 --- a/org/testdata/footnotes.html +++ b/org/testdata/footnotes.html @@ -40,7 +40,9 @@ and other elements

like blocks

-
other non-plain
+
+
other non-plain
+
  • diff --git a/org/testdata/lists.html b/org/testdata/lists.html index 708a94d..7e3a968 100644 --- a/org/testdata/lists.html +++ b/org/testdata/lists.html @@ -48,7 +48,9 @@ and some lines of text

    and another subitem

    -
    echo with a block
    +
    +
    echo with a block
    +