Marked: *"Yo"* not outputted correctly

Created on 18 Oct 2018  路  8Comments  路  Source: markedjs/marked

Describe the bug
Emphasize not working when text contains double quotes

To Reproduce
Steps to reproduce the behavior:

marked demo
commonmark demo

L1 - broken inline elements

Most helpful comment

This was introduced in 0ba2522

All 8 comments

Hi Jonas, thanks for the bug report!

This is indeed a bug in 0.5.1 and also in the latest code on master.

Would you like to submit a PR to fix this?

Started to look at this and found a couple more failing cases

*"Yo"*
*"Yo*
*Yo"*
a*yo"*
a*"yo*
a*"yo"*
a *"yo"*

*< yo >*
*<yo*
*yo>*
a*yo>*
a*<yo*
a*yo<*
a*>yo*
a*< yo >*
a *< yo >*

*[yo]*
*[yo*
*yo]*
a*yo]*
a*[yo*
a*yo[*
a*]yo*
a*[yo]*
a *[yo]*

a*(Yo*

Fixing this is seems like a fairly invasive change as it requires lookahead for square bracket and angle bracket ie to make sure *[yo* works but *[yo*](uri) does not.

Implementing lookahead seems like it would have a performance impact? Any ideas on how you would recommend approaching this?

/cc @davisjam

This was introduced in 0ba2522

It's been more than a year, and this is still an issue (as reported in https://github.com/docsifyjs/docsify/issues/976 and https://github.com/docsifyjs/docsify/issues/787). Is anyone fixing it? Please prioritise it 馃檹

@dialex if you want to submit a PR I would be happy to review it 馃榿

I would if I could, I don't know enough of JS or MarkedJS to be of any help.
I'll ask Santa for Christmas 馃巺馃榿

Workaround: use _"Yo"_ instead of *"Yo"*

This was fixed in #1686 released in v1.1.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UziTech picture UziTech  路  4Comments

chunhei2008 picture chunhei2008  路  3Comments

james4388 picture james4388  路  3Comments

bennycode picture bennycode  路  4Comments

vsemozhetbyt picture vsemozhetbyt  路  4Comments