Add superscript and subscript span extensions#310
Closed
hryhoriiK97 wants to merge 4 commits intomity:masterfrom
Closed
Add superscript and subscript span extensions#310hryhoriiK97 wants to merge 4 commits intomity:masterfrom
hryhoriiK97 wants to merge 4 commits intomity:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #310 +/- ##
==========================================
+ Coverage 78.94% 78.98% +0.03%
==========================================
Files 5 5
Lines 3401 3464 +63
Branches 1138 1167 +29
==========================================
+ Hits 2685 2736 +51
Misses 275 275
- Partials 441 453 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
Rebased and merged into master branch manually. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two opt-in inline span extensions to MD4C.
The new syntaxes are:
When
MD_FLAG_SUPERSCRIPTSis enabled, MD4C emits a newMD_SPAN_SUPERSCRIPTspan. When
MD_FLAG_SUBSCRIPTSis enabled, MD4C emits a newMD_SPAN_SUBSCRIPTspan. The bundled HTML renderer outputs them as:
md2htmlgets two new options:--fsuperscriptsand--fsubscripts.When
MD_FLAG_SUBSCRIPTSandMD_FLAG_STRIKETHROUGHare both active,~text~renders as subscript and
~~text~~remains strikethrough, preserving GFMcompatibility.
A 600-second OSS-Fuzz run found no crashes or assertion failures.
These extensions will be used in react-native-enriched-markdown.