If the character matched by `group(1)` of a pattern is in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS] then return the integer representing the character's Unicode code point (as returned by [`ord`][]) wrapped in [`util.STX`][markdown.util.STX] and [`util.ETX`][markdow
(self, m: re.Match[str], data: str)
| 317 | """ Return an escaped character. """ |
| 318 | |
| 319 | def handleMatch(self, m: re.Match[str], data: str) -> tuple[str | None, int, int]: |
| 320 | """ |
| 321 | If the character matched by `group(1)` of a pattern is in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS] |
| 322 | then return the integer representing the character's Unicode code point (as returned by [`ord`][]) wrapped |
| 323 | in [`util.STX`][markdown.util.STX] and [`util.ETX`][markdown.util.ETX]. |
| 324 | |
| 325 | If the matched character is not in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS], then return `None`. |
| 326 | """ |
| 327 | |
| 328 | char = m.group(1) |
| 329 | if char in self.md.ESCAPED_CHARS: |
| 330 | return '{}{}{}'.format(util.STX, ord(char), util.ETX), m.start(0), m.end(0) |
| 331 | else: |
| 332 | return None, m.start(0), m.end(0) |
| 333 | |
| 334 | |
| 335 | class SimpleTagPattern(Pattern): # pragma: no cover |
nothing calls this directly
no outgoing calls
no test coverage detected