Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wooorm opened this issue Apr 26, 2022 · 1 comment

Comments

@wooorm
Copy link

wooorm commented Apr 26, 2022

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).

@wooorm wooorm changed the title commonmark.js should first evaluate character references, before interpreting as info string commonmark.js should first evaluate character references, before interpreting “words” of the info string Apr 26, 2022
@jgm
Copy link
Member

jgm commented Apr 26, 2022

I agree that commonmark.js's behavior on the first two cases is buggy.
(cmark does the right thing here.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants