HTMLWriter: Fix example block newline
This commit is contained in:
parent
09a8437b59
commit
c759df1efe
2 changed files with 4 additions and 3 deletions
|
@ -114,7 +114,7 @@ func (w *HTMLWriter) writeBlock(b Block) {
|
||||||
}
|
}
|
||||||
w.WriteString(w.HighlightCodeBlock(strings.Join(lines, "\n"), lang) + "\n")
|
w.WriteString(w.HighlightCodeBlock(strings.Join(lines, "\n"), lang) + "\n")
|
||||||
case "EXAMPLE":
|
case "EXAMPLE":
|
||||||
w.WriteString(`<pre class="example">\n`)
|
w.WriteString(`<pre class="example">` + "\n")
|
||||||
w.writeNodes(b.Children...)
|
w.writeNodes(b.Children...)
|
||||||
w.WriteString("</pre>\n")
|
w.WriteString("</pre>\n")
|
||||||
case "QUOTE":
|
case "QUOTE":
|
||||||
|
@ -191,7 +191,7 @@ func (w *HTMLWriter) writeRegularLink(l RegularLink) {
|
||||||
descriptionWriter.writeNodes(l.Description...)
|
descriptionWriter.writeNodes(l.Description...)
|
||||||
description := descriptionWriter.String()
|
description := descriptionWriter.String()
|
||||||
switch l.Protocol {
|
switch l.Protocol {
|
||||||
case "file": // TODO
|
case "file":
|
||||||
url = url[len("file:"):]
|
url = url[len("file:"):]
|
||||||
if strings.Contains(".png.jpg.jpeg.gif", path.Ext(l.URL)) {
|
if strings.Contains(".png.jpg.jpeg.gif", path.Ext(l.URL)) {
|
||||||
w.WriteString(fmt.Sprintf(`<img src="%s" alt="%s" title="%s" />`, url, description, description))
|
w.WriteString(fmt.Sprintf(`<img src="%s" alt="%s" title="%s" />`, url, description, description))
|
||||||
|
|
3
org/testdata/example.html
vendored
3
org/testdata/example.html
vendored
|
@ -168,7 +168,8 @@ auto link, i.e. not inside <code class="verbatim">\[[square brackets]\]</code> <
|
||||||
<div class="highlight"><pre>a source block without a language
|
<div class="highlight"><pre>a source block without a language
|
||||||
and a second line
|
and a second line
|
||||||
and a third one</pre></div>
|
and a third one</pre></div>
|
||||||
<pre class="example">\nan example block
|
<pre class="example">
|
||||||
|
an example block
|
||||||
with multiple lines
|
with multiple lines
|
||||||
</pre>
|
</pre>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue