HTMLWriter: Fix example block newline

This commit is contained in:
Niklas Fasching 2018-12-03 01:24:17 +01:00
parent 09a8437b59
commit c759df1efe
2 changed files with 4 additions and 3 deletions

View file

@ -114,7 +114,7 @@ func (w *HTMLWriter) writeBlock(b Block) {
}
w.WriteString(w.HighlightCodeBlock(strings.Join(lines, "\n"), lang) + "\n")
case "EXAMPLE":
w.WriteString(`<pre class="example">\n`)
w.WriteString(`<pre class="example">` + "\n")
w.writeNodes(b.Children...)
w.WriteString("</pre>\n")
case "QUOTE":
@ -191,7 +191,7 @@ func (w *HTMLWriter) writeRegularLink(l RegularLink) {
descriptionWriter.writeNodes(l.Description...)
description := descriptionWriter.String()
switch l.Protocol {
case "file": // TODO
case "file":
url = url[len("file:"):]
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))

View file

@ -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
and a second line
and a third one</pre></div>
<pre class="example">\nan example block
<pre class="example">
an example block
with multiple lines
</pre>
<blockquote>