commonmark / commonmark/cmark

Improper escaping in commonmark renderer with auto-wrapping

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

Nobody has claimed this yet.

Dominant language
C
Stars
2k
Forks
691
Avg merge
1d 16h
Merged PRs (30d)
1

Description

When --wrap=0 (nowrap) is set, we get proper escaping to prevent an ordered list from being created:

% ./build/src/cmark -t commonmark --width 0
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1\. aaaaaaaaaa 
^D
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1\. aaaaaaaaaa

But with --wrap=72 we don't:

% ./build/src/cmark -t commonmark --width 72
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1\. aaaaaaaaaa 
^D
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. aaaaaaaaaa

See jgm/pandoc#5597

Contributor guide

No contributing guide indexed for this repository

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 discrepancy with the build/src/cmark command using --wrap=0 and --wrap=72, following the input and output shown in the issue. Trace the CommonMark renderer's auto-wrapping path and verify that the wrapped output escapes the list marker consistently with nowrap mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.