euporie.core.convert.formats.html.dollarmath_plugin

euporie.core.convert.formats.html.dollarmath_plugin(md: MarkdownIt, *, allow_labels: bool = True, allow_space: bool = True, allow_digits: bool = True, double_inline: bool = False, label_normalizer: Optional[Callable[[str], str]] = None, renderer: Optional[Callable[[str, Dict[str, Any]], str]] = None, label_renderer: Optional[Callable[[str], str]] = None) None

Plugin for parsing dollar enclosed math, e.g. inline: $a=1$, block: $$b=2$$

This is an improved version of texmath; it is more performant, and handles \ escaping properly and allows for more configuration.

Parameters:
  • allow_labels – Capture math blocks with label suffix, e.g. $$a=1$$ (eq1)

  • allow_space – Parse inline math when there is space after/before the opening/closing $, e.g. $ a $

  • allow_digits – Parse inline math when there is a digit before/after the opening/closing $, e.g. 1$ or $2. This is useful when also using currency.

  • double_inline – Search for double-dollar math within inline contexts

  • label_normalizer – Function to normalize the label, by default replaces whitespace with -

  • renderer – Function to render content: (str, {“display_mode”: bool}) -> str, by default escapes HTML

  • label_renderer – Function to render labels, by default creates anchor