parsedown icon indicating copy to clipboard operation
parsedown copied to clipboard

Emphasis management error

Open jdecool opened this issue 9 years ago • 7 comments

In a document, I have this markdown :

this_text_is_normal 
_this text_is italic_

I expect something like :

<p>this_text_is_normal 
<em>this text_is italic</em></p>

But parsedown generate :

<p>this_text_is_normal
_this text<em>is italic</em></p>

jdecool avatar Jul 30 '14 13:07 jdecool

And what is the logic behind your expectations?

kminchev avatar Jul 30 '14 15:07 kminchev

text_is is a word, there's no separator. It's the same logic as this_text_is_normal.

Try to enter the example in Github and look the result.

jdecool avatar Jul 30 '14 16:07 jdecool

this_text_is_normal 
*this text_is italic*

kminchev avatar Jul 30 '14 18:07 kminchev

@kminchev Your solution works, I'm going to work with at the moment.

But there is still a bug with this input :

this_text_is_normal 
_this text_is italic_

jdecool avatar Jul 31 '14 06:07 jdecool

Same issue with __foo_bar__:

  • expected: <strong>foo_bar</strong>
  • actual: __foo_bar__

Note that all markdown parsers supports this syntax (proof here: foo_bar).

piouPiouM avatar Aug 01 '14 09:08 piouPiouM

I just ran into a similar issue to this where words have control characters in them. For example, the decentralized social network Diaspora* is formally written with an asterisk in the name (i.e., the correct typographical representation of the project is Diaspora* with an asterisk, not Diaspora with no asterisk). The same is true for some renderings of words in sociology (like trans*) and, of course, other areas of more technical specializations, such as those discussed above.

If I have two paragraphs of text that includes such a phrase, like this:

Let's query the Diaspora* pod to see what happens.
Note that Diaspora* has no formal API to speak of, but this query does work, so *shrug*.

My expectation is that only the final word in the second paragraph (*shrug*) will be italicized. However, using Parsedown, what actually gets italicized is the text * has no formal API to speak of, but this query does work, so *.

Basically this is just…well, incorrect, it seems to me.

fabacab avatar Feb 24 '15 22:02 fabacab

This seems to be related to #703 and #364

domsson avatar Jul 29 '19 16:07 domsson