diff --git a/org/html_writer.go b/org/html_writer.go index 0c830de..731f7db 100644 --- a/org/html_writer.go +++ b/org/html_writer.go @@ -123,7 +123,7 @@ func (w *HTMLWriter) WriteBlock(b Block) { content = w.HighlightCodeBlock(content, lang) w.WriteString(fmt.Sprintf("
` + "\n" + content + "\n\n") + w.WriteString(`
` + "\n" + html.EscapeString(content) + "\n\n") case name == "EXPORT" && len(b.Parameters) >= 1 && strings.ToLower(b.Parameters[0]) == "html": w.WriteString(content + "\n") case name == "QUOTE": diff --git a/org/testdata/blocks.html b/org/testdata/blocks.html index a470343..a4da06a 100644 --- a/org/testdata/blocks.html +++ b/org/testdata/blocks.html @@ -32,9 +32,11 @@ empty lines! it also has multiple parameters -src, example & export blocks treat their content as raw text +src, example & export blocks treat their content as raw text /inline/ *markup* is ignored and whitespace is honored and not removed + +content of example blocks is still html escaped - see <script>alert("escaped")</script>
examples like this diff --git a/org/testdata/blocks.org b/org/testdata/blocks.org index 44d93e5..3990008 100644 --- a/org/testdata/blocks.org +++ b/org/testdata/blocks.org @@ -25,6 +25,8 @@ it also has multiple parameters src, example & export blocks treat their content as raw text /inline/ *markup* is ignored and whitespace is honored and not removed + +content of example blocks is still html escaped - see #+END_EXAMPLE : examples like this diff --git a/org/testdata/blocks.pretty_org b/org/testdata/blocks.pretty_org index 239890c..355ed29 100644 --- a/org/testdata/blocks.pretty_org +++ b/org/testdata/blocks.pretty_org @@ -25,6 +25,8 @@ it also has multiple parameters src, example & export blocks treat their content as raw text /inline/ *markup* is ignored and whitespace is honored and not removed + +content of example blocks is still html escaped - see #+END_EXAMPLE : examples like this diff --git a/org/testdata/misc.html b/org/testdata/misc.html index 242bf7c..3e76471 100644 --- a/org/testdata/misc.html +++ b/org/testdata/misc.html @@ -200,7 +200,7 @@ example blocklanguage: go -go: "1.x" +go: "1.x" script: - make test - make generate-gh-pages