From 477a29053898ab7ac83bb1063ad2bb283986f714 Mon Sep 17 00:00:00 2001 From: David Ackroyd Date: Tue, 21 Jul 2020 21:17:34 +0000 Subject: [PATCH 1/2] typo: fixed comment in ApiController --- src/Markdig.WebApp/ApiController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Markdig.WebApp/ApiController.cs b/src/Markdig.WebApp/ApiController.cs index 832ed012..4bbbb09c 100644 --- a/src/Markdig.WebApp/ApiController.cs +++ b/src/Markdig.WebApp/ApiController.cs @@ -13,7 +13,7 @@ namespace Markdig.WebApp return string.Empty; } - // GET api/to_html?text=xxx&extensions=advanced + // GET api/to_html?text=xxx&extension=advanced [Route("api/to_html")] [HttpGet()] public object Get([FromQuery] string text, [FromQuery] string extension) From 8758ba460f9b433fd18003b982c0e9693ceaeb88 Mon Sep 17 00:00:00 2001 From: David Ackroyd Date: Tue, 21 Jul 2020 21:35:52 +0000 Subject: [PATCH 2/2] fix: parsing math blocks with no leading or trailing whitespace --- src/Markdig/Extensions/Mathematics/MathInlineParser.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Markdig/Extensions/Mathematics/MathInlineParser.cs b/src/Markdig/Extensions/Mathematics/MathInlineParser.cs index 5b6f2088..c237dd6a 100644 --- a/src/Markdig/Extensions/Mathematics/MathInlineParser.cs +++ b/src/Markdig/Extensions/Mathematics/MathInlineParser.cs @@ -50,14 +50,12 @@ namespace Markdig.Extensions.Mathematics c = slice.NextChar(); } - bool openNextIsDigit = c.IsDigit(); pc.CheckUnicodeCategory(out bool openPrevIsWhiteSpace, out bool openPrevIsPunctuation); c.CheckUnicodeCategory(out bool openNextIsWhiteSpace, out _); // Check that opening $/$$ is correct, using the different heuristics than for emphasis delimiters - // If a $/$$ is not preceded by a whitespace or punctuation, or followed by a digit - // this is a not a math block - if ((!openPrevIsWhiteSpace && !openPrevIsPunctuation) || openNextIsDigit) + // If a $/$$ is not preceded by a whitespace or punctuation, this is a not a math block + if ((!openPrevIsWhiteSpace && !openPrevIsPunctuation)) { return false; }