This is consistent with Markdown.pl
Allow atx style headers without a space after the #
Hello. This needs tests. Also, you accidentally added a print to your commit.
IIRC this allowing atx headers without a space was dropped a while back on @joestump 's request? Not sure about it being @joestump
I think we had good reasons for requiring spaces in headers. That PR is #90 for reference.
@joestump It probably clashed with our item number parsing. I really don't know what the standard is TBH.
There's another PR floating around here to remove the space requirement, and create a "tag-friendly" extra to require a space so tags are safe. That might be the best route.
It was completely unrelated. I was getting h1 tags on Python comments inside of code blocks I believe.
#90 wasn't about inside a code block was it? It was just in paragraph text. E.g.:
This is my paragraph
#with a work that starts the
line with a hash.
I don't have a great suggestion for this. Ideally the default markdown2.py behavour would match reasonable Markdown.pl behaviour (i.e. allow "#foo" headers, with no space).
I agree. I think i'm going to take this on separately, not requiring the space for a header and adding a tag-friendly extra. I'll make sure the code block parsing is correct around headers too.
Thanks for fixing the right way. I was trying out a lot of different markdown editors and python libraries at the time and they all rendered slightly differently.
The joys of Markdown having no official specification. We deal with this at @sprintly all the time. At this point there are two competing standards: