MartinPacker / mdpre

mdpre - Markdown Preprocessor
MIT License
8 stars 3 forks source link

If <br/> encountered on its own on a line put a backslash on the end of the previous line #24

Closed MartinPacker closed 11 months ago

MartinPacker commented 11 months ago

This would be a convenience.

Consider

* Here is a bullet point \
<br/>
* Here is another bullet point

It would be nice not to have to put that backslash in. Because I might add another bullet point line in before the <br/> line.

This could be done in mdpre - because it's not strictly how Markdown does it.

One wrinkle: It would be slightly more useful to allow multiple breaks on that line, not just one. Should be equally doable.

MartinPacker commented 11 months ago

I looked at the code. This is feasible but it would require reworking the code to buffer the data in memory before writing the whole lot out. Fortunately, I/O is sufficiently abstracted that this ought to be possible.

I can't imagine a use case where the data to be written is so huge that buffering the output in its entirety would be a problem. (Even on the smallest (1GB) Raspberry Pi, for instance.)

Will investigate some more and, perhaps, protototype.

MartinPacker commented 11 months ago

Turned out to be a good deal simpler than that. Released as v0.6.7.