Marked: Two different emphasis are recognized as a single one in a paragraph node

Created on 15 May 2020  路  4Comments  路  Source: markedjs/marked

Thank you for the amazing work, guys! :star2:

Describe the bug
Let's suppose the following paragraph:

Before explaining about Promises, we should understand what is *async programming*. But, before, let's explain *synchronous programming* in a general context.

Before explaining about Promises, we should understand what is is consumed correctly.

The Lexer then calls the method Tokenizer.em() which then evaluates the set of em rules against the text.

But the last rule (/^\*([^\s*"<\[][\s\S]*[^\s])\*(?!\*)/) matches async programming* . But, before, let's explain *synchronous programming

Expected behavior
I expected to have matched only async programming.

To Reproduce
Just try to parse:

Before explaining about Promises, we should understand what is *async programming*. But, before, let's explain *synchronous programming* in a general context.

Demo

  1. Marked Demo
  2. CommonMark Demo

Version: 1.0.0

L1 - broken inline elements

Most helpful comment

Should be fixed with marked v1.1.1 :tada:

All 4 comments

Just commenting to say I've bumped into this issue as well. Seems to do with * followed by punctuation as well?

Marked Demo

I have a PR #1686 that should fix this kind of issue but it's still waiting on feedback from the maintainers.

Can confirm this is fixed now.

Should be fixed with marked v1.1.1 :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UziTech picture UziTech  路  4Comments

bennycode picture bennycode  路  4Comments

learykara picture learykara  路  3Comments

eGavr picture eGavr  路  4Comments

raguay picture raguay  路  4Comments