mdiep / MMMarkdown

An Objective-C framework for converting Markdown to HTML.
MIT License
1.25k stars 168 forks source link

MMMarkdownExtensionsUnderscoresInWords should allow asterisks within words to still bold, italicize and bold italicize #58

Closed iosdev-republicofapps closed 9 years ago

iosdev-republicofapps commented 9 years ago

MMMarkdown diverges a bit from GFM with respect to underscores vs asterisks in words.

In GFM, e.g. what I'm using to edit this issue notice that underscores are not italicized or bolded within a word:

Hello__world__today is not bolded.
// produces:

Helloworldtoday is not bolded.

Whereas GFM does italicize or bold with asterisks within a word:

Hello**world**today is bolded.
// produces:

Helloworldtoday is bolded.

In the GitHub Flavored Markdown Reference they mention that underscores within words are not used for emphasis but that intra-word emphasis can still be achieved using asterisks.

However, the MMMarkdown option MMMarkdownExtensionsUnderscoresInWords turns off both underscores and asterisks within words, whereas based on the name of the option and for consistency with GFM it seems like it should only turn off underscores and not asterisks within words.

This impacts MMSpanParser._parseEmAndStrongWithScanner in a few places.

I like the fact that underscores don't italicize/bold within words: that makes sense for variable names in text. But it would be nice if asterisks still worked. :-)

Thoughts? :-)

Thanks!

mdiep commented 9 years ago

Thanks for the issue! This was a recent change in GitHub Flavored Markdown, and MMMarkdown will need to be updated accordingly.

iosdev-republicofapps commented 9 years ago

@mdiep thanks!!! Any chance of cutting a new release and then I can push a new pod spec version? :-)

mdiep commented 9 years ago

I'll give it a day to see if we can get #59 merged, and then cut a release.

iosdev-republicofapps commented 9 years ago

Sounds good, thanks!

mdiep commented 9 years ago

I just released 0.4.3. Thanks!

iosdev-republicofapps commented 9 years ago

I just pushed 0.4.3 to Cocoapods. Thanks!