Skip to main content

try_parse_inline_math

Function try_parse_inline_math 

Source
pub fn try_parse_inline_math(text: &str) -> Option<(usize, &str)>
Expand description

Try to parse an inline math span starting at the current position. Returns the number of characters consumed if successful, or None if not inline math.

Per Pandoc spec (tex_math_dollars extension):

  • Opening $ must have non-space character immediately to its right
  • Closing $ must have non-space character immediately to its left
  • Closing $ must not be followed immediately by a digit