hellux/jotdown

Comments don't work with headings

Opened this issue · 1 comments

I think that this code

{%
# title

paragraph
%}

should produce nothing.

Instead, it produces:

<p>{%
# title</p>
<p>paragraph
%}</p>

So, it's not possible to comment the headings and the paragraphs too in oneshot, without multiple inline comments?

hellux commented

Unfortunately it is currently not possible to have blank lines within comments, so one cannot easily comment out a big block if it contains blank lines using djot comments.

The reference implementation (https://github.com/jgm/djot.js) has the same behavior, which I have mimicked. There have been discussions about ways to add better block comments for djot in jgm/djot#67.

One workaround is to use raw blocks for a nonexistent render output, e.g. "comment":

```=comment
# title

paragraph
```

This will be cause the whole raw block to be filtered out by the renderer.