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

Negative superscripts do not work #30

Open
SuborbitalPigeon opened this issue Dec 21, 2024 · 4 comments · May be fixed by #31
Open

Negative superscripts do not work #30

SuborbitalPigeon opened this issue Dec 21, 2024 · 4 comments · May be fixed by #31
Labels
bug Something isn't working

Comments

@SuborbitalPigeon
Copy link

Trying to format units such as K^-1 doesn't render properly when using K^-1^ just passes the text through. I need to add a space between the unit and the power. Values of superscripts which don't start with - do work however.

@jmooring
Copy link
Member

jmooring commented Dec 21, 2024

To clarify...

  • This works: K ^-1^
  • This does not: K^-1^

We have the same problem with subscripts, inserts, etc.

TagKind This works This does not work
kindSuperscript K^1^s K^-1^
kindSubscript K~1~ K~-1~
kindInsert K++1++ K++-1++
kindMark K==1== K==-1==
kindDelete K~~1~~ K~~-1~~

The first character within the delimiters must be a number or a letter. It fails if the first character is punctuation of any type.

cc: @bowman2001

@bep bep added the bug Something isn't working label Dec 21, 2024
@jmooring
Copy link
Member

jmooring commented Dec 21, 2024

Goldmark's strikethrough extension has the same problem:
yuin/goldmark#483

And GitHub itself fails as well.

Markdown:

K~1~

K~*1~

Rendered by GitHub:

K1

K~*1~

@SuborbitalPigeon
Copy link
Author

To clarify...

Sorry, I was in a bit of a rush.

@jmooring
Copy link
Member

From Goldmark's project lead:

This kind of extensions [referring to strikethrough] are implemented as same as the emphasis. CommonMark emphasis algorithm is known for complicated and having many edge cases.

This Markdown:

K _1_

K_1_

K_-1_

Is rendered to this:

<p>K <em>1</em></p>
<p>K_1_</p>
<p>K_-1_</p>

Rendering is the same with the Goldmark playground and GitHub.

jmooring added a commit to jmooring/hugo-goldmark-extensions that referenced this issue Dec 22, 2024
jmooring added a commit to jmooring/hugo-goldmark-extensions that referenced this issue Dec 23, 2024
jmooring added a commit to jmooring/hugo-goldmark-extensions that referenced this issue Dec 23, 2024
jmooring added a commit to jmooring/hugo-goldmark-extensions that referenced this issue Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants