Skip to content

Stop non-parenthesized superscipts before clausal stop punctuation#809

Open
deFractal wants to merge 1 commit into
vmg:masterfrom
deFractal:superscript-stop-punct
Open

Stop non-parenthesized superscipts before clausal stop punctuation#809
deFractal wants to merge 1 commit into
vmg:masterfrom
deFractal:superscript-stop-punct

Conversation

@deFractal

@deFractal deFractal commented Jan 25, 2026

Copy link
Copy Markdown

Currently, Redcarpet renders x^y, (where y is the non-parenthesized substring up to but excluding whitespace or the end of string) as x<sup>y,</sup>. The same occurs with other clausal stop punctuation (., ?, !, :, or ;). See, for example, the comma inside the exponent (i.e., 10<sup>6,</sup>, not 10<sup>6</sup>,) in the Mastodon (glitch-soc) post screenshot here.

This patch stops non-parenthesized superscripts before ,, ., ?, !, :, or ;, in the same manner as char_superscript stops them before or \n, so x^y, gets rendered as x<sup>y</sup>,. With the patch applied, if a user does want to include clausal stop punctuation in a superscript, they can still do so using parentheses. This seems to be a more likely expected behaviour.

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

Successfully merging this pull request may close these issues.

1 participant