-
Notifications
You must be signed in to change notification settings - Fork 174
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 by double tildes #71
Comments
Hey! 👋 cmark does it with any number of (matched) tildes, e.g.:
Produces:
Does this help you? |
Sorry if I wasn't clear. 🙂 Example:
should not produce any strikethrough, but
should act like it does now:
I understand that you might not be very interested in this feature but it would really help people to migrate from |
Okay, you're totally clear now 😅 I'm on holiday now for the next week, but when I'm back, I'll investigate if this would be a breaking change (how many people currently use |
Unfortunately, it looks like about fully 50% of strikethrough uses on GitHub.com are with a single tilde on either side 😞 I'm sorry, but we'll be unable to make this change. |
The OPs issue seems to be similar to using underscores for italic |
@kivikakk is there any chance to have this proposal as an option? So on github.com by default it'd be as it is now, but if one wants to use |
Ah, of course! There totally is. Would you like to submit a PR? I'd be happy to accept it. Once done we'll need to also get the plumbing for passing the option through in |
@kivikakk I'm not familiar with the codebase. Could you give some tips, please? 🙂 |
Unfortunately I'm short on time, so I can't give too much assistance (otherwise I'd do it myself); start by looking over |
@kivikakk thank you! Can we keep this issue open then? 🙂 |
Sure thing! |
I've added |
This is done in gjtorikian/commonmarker@1a973ba. Let me know if you need a new |
@kivikakk thank you so much! 👍 |
@kivikakk markdown-it/markdown-it#446 existing relaxed spec (allowing single tilda) will conflict with subscript extension (from pandoc, I think superscript/subscript extensions are good enougth and should not be ignored even if you don't plan to enable those on github. |
Our extension to allow single tilde strikethrough was made to preserve compatibility with the years of content we already had on GitHub.com; we're not going to be able to change that without breaking content; these extensions are for our own use. Anyone is welcome to extend CommonMark for their own use, like we have, but we won't be making any changes here. |
That's technically correct, but CM intent is to unify dialects nightmare (including extensions). For example, when your doc declared 2 tildes - everything was ok. But after info about 1 tilde appeared in official GFM spec, other developpers (like me) are "forced" to fix compatibility (and that's impossible without breaking something else). At first glance, i would suggest several solutions:
|
I'm a bit confused. The GFM spec, based on CommonMark, begun supporting 1 or more tilde: https://github.github.com/gfm/#strikethrough-extension- Unfortunately I no longer have time to work on this myself (my responsibilities at work have changed), but I'll pass along this issue link to the correct team. I understand that the intent of CM is to unify the dialects, but we've taken as much care as we have to implement the extensions we needed on top of CM without affecting core CommonMark compatibility. We have not made and do not intend to make any attempt to unify with other dialects or extensions. |
I can't find link to previous GFM docs (before CM-based spec), but it declared 2 tilde only for strikethrough. When someone read new GFM spec, he does not understand, that single-tilde and any-tilde cases are for legacy docs. That's considered as "MUST be supported". And now we have conflict with another well-known extension, subscript. In ideal world :) after CM core spec done, there are plans to unify popular extensions. And current "unofficial" collision between strikethrough/subscript will become "official". I suggest to prevent this pain, because it's should not be difficult. You could add to spec something like "2 tildes should be used, other combinations are supported for legacy docs and should be avoided in new ones" |
We want to migrate from redcarpet to
github/cmark
.Unfortunately, we have two major blockers. One of them is
strikethrough
.In
redcarpet
double tildes starts strikethrough whilecmark
does that with just one tilde.From redcarpet's readme:
Is there any chance to update cmark somehow to let it use
~~
instead of~
(maybe as an option)?Thank you! 🙂
/cc @kivikakk
The text was updated successfully, but these errors were encountered: