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 extension fails if first character within delimiters is punctuation #483

Open
jmooring opened this issue Dec 21, 2024 · 1 comment

Comments

@jmooring
Copy link
Contributor

jmooring commented Dec 21, 2024

A better description...

The strikethrough extension fails if (a) the first character within the delimiters is punctuation, and (b) the character preceding the opening delimiter is either a letter or a number.

Tested with [email protected] playground

Markdown:

K~1~

K~*1~

Expected:

<p>K<del>1</del></p>
<p>K<del>*1</del></p>

Actual:

<p>K<del>1</del></p>
<p>K~*1~</p>

From the specifications (emphasis mine):

Strikethrough text is any text wrapped in a matching pair of one or two tildes (~).

However, note that GitHub has the same problem. The example above rendered by GitHub:

K1

K~*1~

@jmooring jmooring changed the title Strikethough extension fails if first character within delimiters is punctuation Strikethrough extension fails if first character within delimiters is punctuation Dec 21, 2024
@yuin
Copy link
Owner

yuin commented Dec 22, 2024

This kind of extensions are implemented as same as the emphasis. CommonMark emphasis algorithm is known for complicated and having many edge cases. Espacially the emphasis algorighm is basically designed for sentences written in Western language(that is separated by spaces), other situations like CJK sentences and math often fail.

I think that GFM spec writes spec wrong(Aside from whether CommonMark emphasis algorithm is good or bad)

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