markdown_it.rules_block.state_block module#

class markdown_it.rules_block.state_block.StateBlock(src: str, md: MarkdownIt, env: EnvType, tokens: list[Token])[source]#

Bases: StateBase

getLines(begin: int, end: int, indent: int, keepLastLF: bool) str[source]#

Cut lines range from source.

isEmpty(line: int) bool[source]#

.

is_code_block(line: int) bool[source]#

Check if line is a code block, i.e. the code block rule is enabled and text is indented by more than 3 spaces.

push(ttype: str, tag: str, nesting: Literal[-1, 0, 1]) Token[source]#

Push new token to “stream”.

skipChars(pos: int, code: int) int[source]#

Skip character code from given position.

skipCharsBack(pos: int, code: int, minimum: int) int[source]#

Skip character code reverse from given position - 1.

skipCharsStr(pos: int, ch: str) int[source]#

Skip character string from given position.

skipCharsStrBack(pos: int, ch: str, minimum: int) int[source]#

Skip character string reverse from given position - 1.

skipEmptyLines(from_pos: int) int[source]#

.

skipSpaces(pos: int) int[source]#

Skip spaces from given position.

skipSpacesBack(pos: int, minimum: int) int[source]#

Skip spaces from given position in reverse.