vmg / redcarpet

The safe Markdown parser, reloaded.
MIT License
4.96k stars 524 forks source link

Nested italic and bold not working properly. #396

Open madhurakhal opened 10 years ago

madhurakhal commented 10 years ago

I am using this awesome gem in my current work but run into the problem while nesting bold text inside italic.

Here is the scenario.

This is the code I use:

*You **can** combine them*

This is the code produced by the gem:

<p><em>You *</em>can** combine them*</p>

I would except the following output:

<p><em>You <strong>can<strong> combine them</em></p>

Please see the feedback by clicking on the edit button. Thanks Madhu Rakhal Magar

rdmcelrath commented 9 years ago

Concur - this is an issue I am having as well.

Example:

_foo bar baz _great* baz bar foo scott bar foo baz*

RSpace commented 9 years ago

Same issue here:

carpet = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new)
carpet.render('*test **test** test*')
=> "<p><em>test *</em>test** test*</p>\n"
charmander commented 9 years ago

Weasyl/misaka@90aad1b and Weasyl/misaka@548d921 (minus the change to find_emph_char that Redcarpet seems to have applied already) might fix this.

nullobject commented 7 years ago

+1