Open vilhelmgray opened 7 months ago
Hmm not sure why that would happen but that's not intentional
Looking at components/markdown/src/shortcode/markdown.rs markdown_to_html
method, the call to cmark::push_html the event stack is [Start(Paragraph), Text(Boxed("foobar")), End(Paragraph)]
. Once rendered into the html variable it comes out as "<p>foobar</p>\n"
.
Looking a little further, it looks like the extra line break is with HtmlWriter::end_tag of cmark here.
Tag::Paragraph => {
self.write("</p>\n")?;
}
I have the same problem with some of my shortcodes, the "solution" I ended up doing was just putting the entire shortcode code in one single line and the newline issue didn't occur, at least for me.
On version 0.18.0 of Zola.
Zola version: 0.18.0
I have the following shortcode as
templates/shortcodes/blog_example.html
:I use the shortcode like this:
I see the following HTML output generated:
A superfluous newline was introduced at the end of the
markdown
filter output. If I remove themarkdown
filter and leave justbody
, no extra newline is generated.Is this extra newline behavior intentional? I'm not sure if this is related to https://github.com/getzola/zola/issues/2234.