karlb / smu

Simple MarkUp - markdown/commonmark like syntax
http://karlb.github.io/smu/
MIT License
55 stars 5 forks source link

Blank lines in code blocks within list items #2

Closed adriangrigore closed 2 years ago

adriangrigore commented 3 years ago

For the following file:

* a
  * b
        a

        b

smu renders:

<ul>
<li><p>a
<ul>
<li>b
<pre><code>a
</code></pre>
</li>
</ul>
</p>
<pre><code>  b
</code></pre>
</li>
</ul>

and I would rather have it render something like:

<ul>
<li>a
<ul>
<li>b
<pre><code>a

b
</code></pre>
</li>
</ul>
</li>
</ul>

Can I have it so smu respect blank lines in code block within lists? Any recommended way of solving this?

karlb commented 2 years ago

Sorry for the late reply. I didn't have notifications turned on for this repo, because notifications default to off for forks.

Since smu generally works on sections of the of the input, you can't just strip off the indentation at the start of the line and run the usual processing. Two approaches would be:

I don't like either approach very much and don't see a better approach at the moment. If anyone has a good idea, please chime in. Otherwise I vote for just leaving this feature out.

karlb commented 2 years ago

I'm closing this issue, since I don't see a way to implement this with a good benefit/complexity ratio. If you see a good way to do it, feel free to send a PR and reopen.