Closed ArthurHoaro closed 6 years ago
This looks like a duplicate of https://github.com/erusev/parsedown/issues/265
Well #265 seems to be the exact opposite (and the issue closed), but yes, that's related. In this thread, you said that this behaviour is expected, due to existing texts. Why not, but what specification should we refer to when using Parsedown?
There's a long and ongoing discussion about the topic at CommonMark forums - looks like this is a rule that might change in future versions of CommonMark.
@erusev I know that https://github.com/erusev/parsedown/issues/265 happened which previously caused a fix for this issue to be reverted. Given that this occurred over three years ago, I wonder whether given the success of CommonMark in that time, it might be best to behave according to spec by default? Perhaps we could add a setter for those that really don't want to have a space there.
I really need proper support for lines that begin with #hashtags, per the CommonMark and GFM specs. Please consider pull request #589.
Closing as #589 was merged.
The current plan is to add a strict mode in 1.8.0
(as suggested in https://github.com/erusev/parsedown/issues/265#issuecomment-70016695) to hopefully side step this dichotomy between supporting a commonly used deviation from the spec, and honouring the spec.
Currently this is the only case that strict mode controls, but this opens up the possibility of releasing very breaking (but compliant) changes in the future into strict mode (similar to this case) since the intent of the setter is to be compliant.
I think it is wise to be as compliant as possible even when strict mode is off, but if there are changes where compliance generates major unforeseen breakage in existing texts (like #265) then it is nice to be able to limit that change to those that want strict compliance.
Using Parsedown 1.6.
Currently, this
will render as:
As specified in CommonMark specification:
Also:
Expected result, same as Github:
nottitle
Use case: I extended Parsedown to support
#hashtags
in my software, and hashtags set at the beginning of a new line now generate a header.EDIT: that's probably not the best way to do it, but I added this to my Parsedown extension to fix it: