diff --git a/src/Markdig.Tests/Specs/EmphasisExtraSpecs.md b/src/Markdig.Tests/Specs/EmphasisExtraSpecs.md index 72f360d3..e1dada02 100644 --- a/src/Markdig.Tests/Specs/EmphasisExtraSpecs.md +++ b/src/Markdig.Tests/Specs/EmphasisExtraSpecs.md @@ -21,6 +21,17 @@ H~2~O is a liquid. 2^10^ is 1024 .
H2O is a liquid. 210 is 1024
```````````````````````````````` + +Certain punctuation characters are exempted from the rule forbidding them within inline delimiters + +```````````````````````````````` example +One quintillionth can be expressed as 10^-18^ + +Daggers^†^ and double-daggers^‡^ can be used to denote notes. +. +One quintillionth can be expressed as 10-18
+Daggers† and double-daggers‡ can be used to denote notes.
+```````````````````````````````` ## Inserted diff --git a/src/Markdig.Tests/Specs/Specs.cs b/src/Markdig.Tests/Specs/Specs.cs index 5251bd7c..800161c3 100644 --- a/src/Markdig.Tests/Specs/Specs.cs +++ b/src/Markdig.Tests/Specs/Specs.cs @@ -17357,6 +17357,29 @@ namespace Markdig.Tests Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 2, "Extensions Superscript and Subscript"); TestParser.TestSpec("H~2~O is a liquid. 2^10^ is 1024", "H2O is a liquid. 210 is 1024
", "emphasisextras|advanced"); } + } + // Certain punctuation characters are exempted from the rule forbidding them within inline delimiters + [TestFixture] + public partial class TestExtensionsSuperscriptandSubscript + { + [Test] + public void Example003() + { + // Example 3 + // Section: Extensions Superscript and Subscript + // + // The following CommonMark: + // One quintillionth can be expressed as 10^-18^ + // + // Daggers^†^ and double-daggers^‡^ can be used to denote notes. + // + // Should be rendered as: + //One quintillionth can be expressed as 10-18
+ //Daggers† and double-daggers‡ can be used to denote notes.
+ + Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Superscript and Subscript"); + TestParser.TestSpec("One quintillionth can be expressed as 10^-18^\n\nDaggers^†^ and double-daggers^‡^ can be used to denote notes.", "One quintillionth can be expressed as 10-18
\nDaggers† and double-daggers‡ can be used to denote notes.
", "emphasisextras|advanced"); + } } // ## Inserted // @@ -17365,9 +17388,9 @@ namespace Markdig.Tests public partial class TestExtensionsInserted { [Test] - public void Example003() + public void Example004() { - // Example 3 + // Example 4 // Section: Extensions Inserted // // The following CommonMark: @@ -17376,7 +17399,7 @@ namespace Markdig.Tests // Should be rendered as: //Inserted text
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 3, "Extensions Inserted"); + Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions Inserted"); TestParser.TestSpec("++Inserted text++", "Inserted text
", "emphasisextras|advanced"); } } @@ -17387,9 +17410,9 @@ namespace Markdig.Tests public partial class TestExtensionsMarked { [Test] - public void Example004() + public void Example005() { - // Example 4 + // Example 5 // Section: Extensions Marked // // The following CommonMark: @@ -17398,7 +17421,7 @@ namespace Markdig.Tests // Should be rendered as: //Marked text
- Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 4, "Extensions Marked"); + Console.WriteLine("Example {0}" + Environment.NewLine + "Section: {0}" + Environment.NewLine, 5, "Extensions Marked"); TestParser.TestSpec("==Marked text==", "Marked text
", "emphasisextras|advanced"); } } diff --git a/src/Markdig/Helpers/CharHelper.cs b/src/Markdig/Helpers/CharHelper.cs index 1392b5fb..85748ab6 100644 --- a/src/Markdig/Helpers/CharHelper.cs +++ b/src/Markdig/Helpers/CharHelper.cs @@ -23,6 +23,8 @@ namespace Markdig.Helpers // We don't support LCDM private static IDictionary