Closed ghost closed 10 years ago
nice catch. i'll patch this later today.
while technically it should, this regex won't catch things like
<strong> foo bar
baz
</strong>
supporting this would be an easy tweak (just adding a /gm
flag to the regex), so open a new issue if you run into it.
Hm.. I ran into a some similar issue. The regex isn't treating
characters as whitespace characters.
So maybe the following HTML
<strong> word </strong>
should be converted as such:
\u00A0;**word** \u00A0
Want me to open this as a new issue?
Thanks for your continued support. I would buy you a beer if I could :).
The following HTML
first <em><strong>second</strong> </em>third
gets converted to
first _**second**_third
But I believe the expected result should be:
first _**second**_ third
If a
<strong>
and<em>
has trailing whitespace in the beginning or in the end of its text, the trailing space is preserved when converting it to markdown. At glance, this may sound like something we want but this causes the converted markdown to be invalid.For example, the following HTML:
gets converted to the following markdown which doesn't render properly (copy this markdown into a markdown editor and preview it).
Can the trailing white space be moved out of the surrounding \ so that the trailing whitespace can be preserved and a markdown editor can properly render the text bold?
For example: this is what i think is the desirable outcome