Skip to content

Commit

Permalink
Add explaination for mdformat plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
augustelalande committed Mar 20, 2024
1 parent 688ee1b commit be4da1a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/_mdformat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@


class NoEscapeTextPlugin:
"""Overrides the default text formatting behavior of mdformat."""
r"""Overrides the default text formatting behavior of mdformat.
By default mdformat will escape any markdown special character found in a
text block, e.g., <. Some of these characters are found in our
documentation, and when escaped (i.e. \<) will be rendered incorrectly by
mkdocs, i.e., the backslash will appear in the render. Because our only
purpose in using mdformat is to manage the line-breaks, it makes sense to
override its text formatting behavior.
"""

def __init__(self: NoEscapeTextPlugin) -> None:
self.POSTPROCESSORS = {"text": NoEscapeTextPlugin.text}
Expand Down

0 comments on commit be4da1a

Please sign in to comment.