vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Not parsing emphasis when followed by some characters #60

Closed caius closed 12 years ago

caius commented 12 years ago

I've thrown a bunch of test cases in https://gist.github.com/1166716 to show how it fails. From the markdown spec on <em> it states you can use the emphasis delimiters in the middle of a word, and I'm failing to see how 0, ™, °, » trailing it are not covered by that part of the spec. If I wanted it to literally output _Just_™ then I'd write \_Just\_™ to make sure it wasn't interpreted as emphasis.

It's parsed correctly (in my eyes) by markdown.pl - the markdown implementation by John Gruber (and used by TextMate's markdown bundle to preview documents.)

vmg commented 12 years ago

Hey, I'm afraid that you're prasing Markdown with the NO_INTRA_EMPHASIS extension enabled (all extensions are enabled by default on the CLI application that ships with Sundown).

That extension disables the emphasis characters when inside of a word, to allow people to write programming_identifiers_and_names without trigger emphasis in the middle and making it look "weird". If you disable the given extension, the intra-word behavior is exactly the same as in markdown.pl.

...Yes, I do know that it's not a good idea to ship the Sundown binary with all extensions enabled by default. I'll fix that. ;d

caius commented 12 years ago

Ah okay, github must have that extension enabled as well. Guess I'll just put up with it on here then. Thanks for the quick response! :)

vmg commented 12 years ago

Yes, it's certainly enabled on here too. Being a website about sharing code, we found that a lot of our users were writing_identifiers without encasing them in backticks, and getting very weird output as a result.

Sorry if it's an inconvenience. Cheers!