mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #57] [MERGED] Adds exceptions to allow certain punctuation characters to behave as inline delimiters #796
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/57
Author: @christophano
Created: 9/14/2016
Status: ✅ Merged
Merged: 9/15/2016
Merged by: @xoofx
Base:
master← Head:bugfix/punctuation-exceptions📝 Commits (1)
e7df7faAdds exceptions to allow certain punctuation characters to behave as inline delimiters📊 Changes
3 files changed (+47 additions, -8 deletions)
View changed files
📝
src/Markdig.Tests/Specs/EmphasisExtraSpecs.md(+11 -0)📝
src/Markdig.Tests/Specs/Specs.cs(+29 -6)📝
src/Markdig/Helpers/CharHelper.cs(+7 -2)📄 Description
I'm not sure how you'll feel about this one.
The CommonMark spec identifies when whitespace and punctuation can be used as left- and right-flanking delimiter runs. This logic is also used for the extra emphasis extension.
There are cases where certain puntuation characters should(?) be allowed.
For example, the minus symbol (or it's more commonly used lookalike, the dash) ought to be allowed as the start of a superscript span:
Similarly the dagger and double-dagger are commonly used as localised note markers (followed by §, || and #) so should be allowed as the sole contents of a superscript span:
Note 1: this is implemented as a broad exception for these characters (plus dash, as it is more likely to be used than the actual minus). There is no check for the type of delimiter it is to be used for.
Note 2: i have only added the dagger and double dagger to the exceptions. To extend it to include section, parallels and hash would need a small logic change, as parallels uses 2 characters.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.