html: Do not render non-html export blocks
This commit is contained in:
parent
c68d931100
commit
6ed46ba95d
3 changed files with 14 additions and 2 deletions
|
@ -124,8 +124,10 @@ func (w *HTMLWriter) WriteBlock(b Block) {
|
|||
w.WriteString(fmt.Sprintf("<div class=\"src src-%s\">\n%s\n</div>\n", lang, content))
|
||||
case name == "EXAMPLE":
|
||||
w.WriteString(`<pre class="example">` + "\n" + html.EscapeString(content) + "\n</pre>\n")
|
||||
case name == "EXPORT" && len(b.Parameters) >= 1 && strings.ToLower(b.Parameters[0]) == "html":
|
||||
w.WriteString(content + "\n")
|
||||
case name == "EXPORT":
|
||||
if len(b.Parameters) >= 1 && strings.ToLower(b.Parameters[0]) == "html" {
|
||||
w.WriteString(content + "\n")
|
||||
}
|
||||
case name == "QUOTE":
|
||||
w.WriteString("<blockquote>\n" + content + "</blockquote>\n")
|
||||
case name == "CENTER":
|
||||
|
|
5
org/testdata/blocks.org
vendored
5
org/testdata/blocks.org
vendored
|
@ -57,6 +57,11 @@ console.log("Hello World!")
|
|||
</script>
|
||||
#+END_EXPORT
|
||||
|
||||
#+BEGIN_EXPORT something-other-than-html
|
||||
I won't be rendered as html
|
||||
#+END_EXPORT
|
||||
|
||||
|
||||
- list item 1
|
||||
blocks can contain unindented lines that would normally end a list item
|
||||
#+BEGIN_EXAMPLE
|
||||
|
|
5
org/testdata/blocks.pretty_org
vendored
5
org/testdata/blocks.pretty_org
vendored
|
@ -57,6 +57,11 @@ console.log("Hello World!")
|
|||
</script>
|
||||
#+END_EXPORT
|
||||
|
||||
#+BEGIN_EXPORT something-other-than-html
|
||||
I won't be rendered as html
|
||||
#+END_EXPORT
|
||||
|
||||
|
||||
- list item 1
|
||||
blocks can contain unindented lines that would normally end a list item
|
||||
#+BEGIN_EXAMPLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue