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

Trailing tabs after closing fence marker #122

Open
rlidwka opened this issue Aug 3, 2017 · 0 comments
Open

Trailing tabs after closing fence marker #122

rlidwka opened this issue Aug 3, 2017 · 0 comments

Comments

@rlidwka
Copy link
Contributor

rlidwka commented Aug 3, 2017

Test case:

$ cat test.md | sed 's/\t/<TAB>/g'
```
foo
```<TAB>
bar

Commonmark.js doesn't close fence because there's a trailing tab there:

$ ~/commonmark/bin/commonmark ./test.md 
<pre><code>foo
```	
bar
</code></pre>

Cmark disagrees:

$ ~/cmark/build/src/cmark ./test.md 
<pre><code>foo
</code></pre>
<p>bar</p>

There is no test in the spec for this exact case. But there is a similar case for thematic breaks (example 11) where trailing tabs are expanded to spaces:

$ echo -e ' -\t-\t-\t' | ~/commonmark/bin/commonmark 
<hr />

Also, consider the following case (imagine if user appends tabs everywhere):

```js<TAB>
foo<TAB>
```<TAB>
bar<TAB>

If line 1 is considered fence opener (as it does in both implementations), surely line 3 should be considered a closer?


Original issue is opened as markdown-it#388, which behavior is the same as cmark in this case.

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

1 participant