Skip to content

Commit 25506f2

Browse files
committed
Fix plus superscript parsing (#791)
1 parent 5006184 commit 25506f2

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Markdig.Tests/Specs/EmphasisExtraSpecs.generated.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ public void ExtensionsSuperscriptAndSubscript_Example003()
6565
// The following Markdown:
6666
// One quintillionth can be expressed as 10^-18^
6767
//
68-
// Daggers^†^ and double-daggers^‡^ can be used to denote notes.
68+
// Daggers^†^ and double-daggers^‡^ can be used to denote notes. Plus signs^+^ and entity plus signs^+^ can be used in superscript and subscript: H~+~ and H~+~.
6969
//
7070
// Should be rendered as:
7171
// <p>One quintillionth can be expressed as 10<sup>-18</sup></p>
72-
// <p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes.</p>
72+
// <p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes. Plus signs<sup>+</sup> and entity plus signs<sup>+</sup> can be used in superscript and subscript: H<sub>+</sub> and H<sub>+</sub>.</p>
7373

74-
TestParser.TestSpec("One quintillionth can be expressed as 10^-18^\n\nDaggers^†^ and double-daggers^‡^ can be used to denote notes.", "<p>One quintillionth can be expressed as 10<sup>-18</sup></p>\n<p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes.</p>", "emphasisextras|advanced", context: "Example 3\nSection Extensions / Superscript and Subscript\n");
74+
TestParser.TestSpec("One quintillionth can be expressed as 10^-18^\n\nDaggers^†^ and double-daggers^‡^ can be used to denote notes. Plus signs^+^ and entity plus signs^&plus;^ can be used in superscript and subscript: H~+~ and H~&plus;~.", "<p>One quintillionth can be expressed as 10<sup>-18</sup></p>\n<p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes. Plus signs<sup>+</sup> and entity plus signs<sup>+</sup> can be used in superscript and subscript: H<sub>+</sub> and H<sub>+</sub>.</p>", "emphasisextras|advanced", context: "Example 3\nSection Extensions / Superscript and Subscript\n");
7575
}
7676
}
7777

src/Markdig.Tests/Specs/EmphasisExtraSpecs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Certain punctuation characters are exempted from the rule forbidding them within
2727
```````````````````````````````` example
2828
One quintillionth can be expressed as 10^-18^
2929
30-
Daggers^†^ and double-daggers^‡^ can be used to denote notes.
30+
Daggers^†^ and double-daggers^‡^ can be used to denote notes. Plus signs^+^ and entity plus signs^&plus;^ can be used in superscript and subscript: H~+~ and H~&plus;~.
3131
.
3232
<p>One quintillionth can be expressed as 10<sup>-18</sup></p>
33-
<p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes.</p>
33+
<p>Daggers<sup>†</sup> and double-daggers<sup>‡</sup> can be used to denote notes. Plus signs<sup>+</sup> and entity plus signs<sup>+</sup> can be used in superscript and subscript: H<sub>+</sub> and H<sub>+</sub>.</p>
3434
````````````````````````````````
3535

3636
## Inserted

src/Markdig/Helpers/CharHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static class CharHelper
8080

8181
[MethodImpl(MethodImplOptions.AggressiveInlining)]
8282
private static bool IsPunctuationException(char c) =>
83-
c is '−' or '-' or '†' or '‡';
83+
c is '−' or '-' or '+' or '†' or '‡';
8484

8585
[MethodImpl(MethodImplOptions.AggressiveInlining)]
8686
private static bool IsPunctuationException(Rune c) =>

0 commit comments

Comments
 (0)