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

strikethrough incorrect for 3+ tildes #301

Closed
dwelle opened this issue Nov 22, 2016 · 5 comments
Closed

strikethrough incorrect for 3+ tildes #301

dwelle opened this issue Nov 22, 2016 · 5 comments

Comments

@dwelle
Copy link

dwelle commented Nov 22, 2016

~~~text~~~

renders to (taken from markdown-it's repl):

<pre class="hljs"><code></code></pre>

GFM ignores the extra ~ and renders:

<p><del>text</del></p>
@puzrin
Copy link
Member

puzrin commented Nov 23, 2016

See example. ~~~ at start of line is a fenced block, according to CM spec.

I'd recommend to discuss at commonmark forum https://talk.commonmark.org/t/a-problem-with-backtick-code-fences/1053

@puzrin
Copy link
Member

puzrin commented Nov 23, 2016

Do you have example from real world when ~~~ needed at start of paragraph?

@dwelle
Copy link
Author

dwelle commented Nov 23, 2016

E.g. when users mistype (when they want to cross-out paragraph or sth) and wonder why their text suddenly disappeared.

Edit: I thought it's a bug since I wasn't aware of that discussion and the fact it's actually in CM spec. Either way, I think overloading ~ operator for code blocks might not be a good idea for the above reason. If anything, I'd use ~~~ for block-strike-through, which is a requested feature, too.

WTBS, shouldn't the closing ~~~ be on new line for it to be considered fenced block, acc to CM spec?

@puzrin
Copy link
Member

puzrin commented Nov 23, 2016

spec.commonmark.org/0.27/#fenced-code-blocks it's better to discuss spec-related things in other place.

closing as not a bug.

@puzrin puzrin closed this as completed Nov 23, 2016
@dwelle
Copy link
Author

dwelle commented Nov 23, 2016

Still, as I said above, acc to CM spec, the closing ~~~ must not be on the same line as the opening sequence, else it's not considered a code block.

Any text after opening fenced block sequence is considered info string, and if the line contains the closing sequence, it's not considered code block at all.

The spec is kinda not explicit about this, tho, but it can be verified at their dingus.

input:

~~~text~~~

CM output:

<p>~~~text~~~</p>

md-it output:

<pre class="hljs"><code></code></pre>

So currently, md-it is not spec compliant.

Markdown-it's fenced block using the ``` sequence does behave according to CM spec, so the ~~~ behavior is not even consistent in this regard.

@puzrin puzrin reopened this Nov 23, 2016
jmalarcon pushed a commit to jmalarcon/markdown-it that referenced this issue Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants