commonmark / commonmark/commonmark.js

Non-alphabetical start of the string breaks the markup in some cases

Open
#287 0 comments 1 reaction 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

Good morning,

I'm the author of the Jira ADF -> Markdown converter(not published yet). And I faced the next issue in some advanced cases. The easiest way to describe such cases is to provide the examples:

**bold*****bold italic***   // works correct
**bold** ***|bold italic*** // works correct
**bold*****|bold italic*** // works incorrect
**bold****​*​bold italic​*​** // works incorrect

The problem is when there are several similar rules one-by-one without any breaks, the non-alphabetical symbol at the start of the string breaks the markup, even though it's not used for any rules.
In the last example I used a Zero-width space to be sure that there are no rules used for such symbols.

I would appreciate it if you resolve this bug.

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

The issue names no files or tests. Reproduce the four markup examples in the JavaScript parser, then trace inline-markup handling; done means the failing adjacent-rule and zero-width-space cases parse like the working examples, with regression coverage for them.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.