decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
53 stars 13 forks source link

[:vspace](1ex) may produce empty `<p></p>` #101

Closed kno10 closed 3 months ago

kno10 commented 5 months ago

To increase spacing (for semantic reasons), I sometimes insert vspace:

Text:

- bullets

[:vspace](1ex)

Text:

- bullets

However, this renders into

<p>Text:</p>
<ul>...</ul>
<p></p>
<div style="display:block; clear:both; height:1ex;"></div>
<p></p>
<p>Text:</p>
<ul>...</ul>

Removing the newlines around the vspace make the subsequent text not be a paragraph at all. Putting just the HTML instead of the vspace macro works as desired.

monofon commented 3 months ago

Hm, the browser seems to hallucinate these empty <p></p> tags. The generated HTML looks like this:

<p>Line 1</p>
<p><div style="display:block; clear:both; height:10em;"></div></p>
<p>Line 2</p>

The reason might be, that <p><div></div></p> is not exactly legal HTML. The browser seems to know that.

Decker processes macros in an Inline context and generates a RawInline element. The Pandoc writer seems to automatically wrap this in a <p> element because it is surrounded by empty lines.

monofon commented 3 months ago

Using a <span> here helps.