commonmark / commonmark/commonmark.js

Incorrect emphasis handling

Open
#221 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.6k
Forks
231
Avg merge
2d 11h
Merged PRs (30d)
3

Description

(Distilled from https://talk.commonmark.org/t/i-dont-understand-how-emphasis-is-parsed/3866)

Input:

*****Hello*world****

Actual Output:

<p>*****Hello<em>world</em>***</p>

Expected Output:

<p>**<em><strong>Hello<em>world</em></strong></em></p>

More detailed rationale can be found in this comment: https://talk.commonmark.org/t/i-dont-understand-how-emphasis-is-parsed/3866/8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Markdown input *****Hello*world**** and trace the emphasis parsing entry point to compare the actual and expected HTML. Add a regression test for this example and confirm the parser produces the expected nested emphasis and strong elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.