mmarkdown / mmark

Mmark: a powerful markdown processor in Go geared towards the IETF
https://mmark.miek.nl
Other
480 stars 45 forks source link

Extra linefeed at the end of codeblocks in HTML output of xml2rfc #220

Closed d-javu closed 2 months ago

d-javu commented 2 months ago

The introduction of CDATA wrapping of code blocks in a73be65 (#187) causes xml2rfc to output an extra line at the end of the code block. This is because the 'end CDATA marker' includes a newline.

The minimal fix seems to be:

--- a/render/xml/renderer.go
+++ b/render/xml/renderer.go
@@ -533,7 +533,7 @@ func (r *Renderer) codeBlock(w io.Writer, codeBlock *ast.CodeBlock) {
        } else {
                r.outs(w, "<![CDATA[")
                r.out(w, codeBlock.Literal)
-               r.outs(w, "]]>\n")
+               r.outs(w, "]]>")
        }
        r.outs(w, "</"+name+">")
        r.cr(w)