diff options
author | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
---|---|---|
committer | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
commit | 12cf076118570eebbff08c6b3090e0d4798447a1 (patch) | |
tree | 3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py | |
parent | c45662ff3923b34614ddcc8feb9195541166dcc5 (diff) |
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py')
-rw-r--r-- | venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py b/venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py deleted file mode 100644 index 16df05f..0000000 --- a/venv/lib/python3.11/site-packages/markdown_it/rules_block/hr.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Horizontal rule - -At least 3 of these characters on a line * - _ -""" -import logging - -from ..common.utils import isStrSpace -from .state_block import StateBlock - -LOGGER = logging.getLogger(__name__) - - -def hr(state: StateBlock, startLine: int, endLine: int, silent: bool) -> bool: - LOGGER.debug("entering hr: %s, %s, %s, %s", state, startLine, endLine, silent) - - pos = state.bMarks[startLine] + state.tShift[startLine] - maximum = state.eMarks[startLine] - - if state.is_code_block(startLine): - return False - - try: - marker = state.src[pos] - except IndexError: - return False - pos += 1 - - # Check hr marker - if marker not in ("*", "-", "_"): - return False - - # markers can be mixed with spaces, but there should be at least 3 of them - - cnt = 1 - while pos < maximum: - ch = state.src[pos] - pos += 1 - if ch != marker and not isStrSpace(ch): - return False - if ch == marker: - cnt += 1 - - if cnt < 3: - return False - - if silent: - return True - - state.line = startLine + 1 - - token = state.push("hr", "hr", 0) - token.map = [startLine, state.line] - token.markup = marker * (cnt + 1) - - return True |