commonmark / commonmark/commonmark.js

`commonmark.js` should first evaluate character references, before interpreting “words” of the info string

Open
#255 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

Here are some examples:

```	js
```
``` js
```
``` js
```
```js	
```
```js 
```
```js 
```
```js	a
```
```js a
```
```js a
```

While the spec is somewhat vague, I believe that the encoded whitespace in the first two examples, should behave like spaces, which is what happens with all the other examples, and that that is the intent of the spec.
Github does treat all these examples as js, and adds their class to it. CommonMark.js currently yields:

<pre><code></code></pre>
<pre><code></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>
<pre><code class="language-js"></code></pre>

I expect <pre><code class="language-js"></code></pre> for everything (like GH).

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 provides fenced-code examples for commonmark.js and the expected HTML output; start by reproducing those examples with the parser. Trace how the info string is interpreted and character references are evaluated, then add coverage showing that each encoded whitespace case produces the expected language-js class.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.