Allow atx style headers without a space after the # #100

Closed
wants to merge 1 commit into from

4 participants

@sirwart

This is consistent with Markdown.pl

@nicholasserra
Collaborator

Hello. This needs tests. Also, you accidentally added a print to your commit.

@trentm
Owner

IIRC this allowing atx headers without a space was dropped a while back on @joestump 's request? Not sure about it being @joestump

@joestump
Collaborator

I think we had good reasons for requiring spaces in headers. That PR is #90 for reference.

@nicholasserra
Collaborator

@joestump It probably clashed with our item number parsing. I really don't know what the standard is TBH.

@nicholasserra
Collaborator

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.

@joestump
Collaborator

It was completely unrelated. I was getting h1 tags on Python comments inside of code blocks I believe.

@trentm
Owner

#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).

@nicholasserra
Collaborator

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.

@sirwart

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.

@joestump
Collaborator

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:

  • The initial one outlined on Daring Fireball.
  • GitHub flavored Markdown.

😦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment