List of classes in the ude.renderers.markdown_safety namespace.
| Entity Name | Description |
|---|---|
| link_destination_is_unsafe | True when a link destination has a scheme that is not in SAFE_LINK_SCHEMES, after the tricks a browser (or a Markdown renderer) undoes: HTML entities (javascript:), percent-escapes, invisible and control characters, letter case. |
| _destination_span | The (start, end) of the link destination that begins after the “(” at text[start - 1]: either <...> or a run without whitespace in which parentheses balance (CommonMark), with backslash escapes. |
| neutralize_unsafe_links | Replaces the destination of every inline link or image and every reference definition whose scheme is unsafe by #; the visible text of the link stays. Applied to the prose between fenced blocks, code spans included: a link written inside backticks is literal text, so changing it costs nothing and removes any doubt about what is code. |
| _escape_angle_brackets | |
| _code_spans | The (start, end) of every inline code span of one line (a backtick run closed by the nearest run of the same length), or None when some backtick run finds no partner on the line: that run may pair with one on another line, or be literal, and parsers disagree about which. |
| _escape_line | Escapes < and > in one line, keeping the content of the given code spans (None = no span is trusted and everything is escaped). Escaping inside a real span only shows the entity as text: a cosmetic cost. |
| _escape_prose_block | The prose between two fenced blocks: links with an unsafe destination are neutralized over the whole block (a destination may start on the line after the opening parenthesis), then the lines are escaped. Code spans are trusted only if EVERY line of the block is unambiguous (_code_spans): an unpaired run on one line can pair with a run on the next, which moves the boundary of the spans there, so one ambiguous line makes the whole block plain prose. |
| escape_markdown_prose | The documentation text made safe for any Markdown renderer (see the module docstring). Fenced code blocks (a line of three or more backticks or tildes opens one, a line of at least as many of the same character closes it, an unclosed fence runs to the end) are returned unchanged; so are unambiguous inline code spans (_escape_line). |
| yaml_string | A value for a YAML front matter line: a double-quoted scalar in which a quote, a backslash and every control character are escaped (K13, CR-12). A JSON string is a valid YAML double-quoted scalar; the three Unicode line separators that JSON leaves as they are would break a line in YAML, so they are escaped too. |
| code_span | An inline code span holding text that the text itself cannot close: the fence is one backtick longer than the longest backtick run inside, and a space pads a text that starts or ends with a backtick (CommonMark). Line breaks become spaces, because a code span lives inside one paragraph. |
| SAFE_LINK_SCHEMES | |
| _BACKTICK_RUN | |
| _FENCE_OPEN | |
| _FENCE_NOT_AT_COLUMN_0 | |
| _REFERENCE_DEFINITION | |
| _INVISIBLE | |
| _SCHEME |
Generated with Flude
Copyright © 2026