Merge pull request #452 from davidackroyd99/bug/parsing-math

Bug/parsing math
This commit is contained in:
Alexandre Mutel
2020-07-22 22:16:54 +02:00
committed by GitHub
2 changed files with 3 additions and 5 deletions

View File

@@ -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)

View File

@@ -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;
}