RealAtix / mdbook-private

A preprocessor that supports private sections
Mozilla Public License 2.0
9 stars 1 forks source link

Private Block at the beginning of file or exactly after Heading #13

Open sepbijani opened 3 months ago

sepbijani commented 3 months ago

Hi, if private block is the first line after heading or beginning of the document, the markdown syntax will not rendered properly: image

# TEST
<!--private
Another *line*.

# A title that should remain a title  
Yet another **line**.
-->
RealAtix commented 3 months ago

The actual issue is that the first line in a private block somehow doesn't get parsed as markdown.

This plugin doesn't handle markdown, that's done in mdbook itself. If you set style = false in book.toml it will work. In order to have a style, without requiring the user to override the mdbook theme and add their style CSS class, I opted to re-use the blockquote element which is built-in.

There's an issue with how the markdown parser interacts with the blockquote element. I'll see if there's a way I can make it work, or possibly find the issue in mdbook.

Example not working

# TEST
<!--private
Another *line*. <--- doesn't work

# A title that should remain a title  
Yet another **line**.
-->

Example working

# TEST
<!--private
Something else here first.

Another *line*. <--- works

# A title that should remain a title  
Yet another **line**.
-->