MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / __findPlaceholder

Method __findPlaceholder

markdown/treeprocessors.py:96–112  ·  view source on GitHub ↗

Extract id from data string, start from index. Arguments: data: String. index: Index, from which we start search. Returns: Placeholder id and string index, after the found placeholder.

(self, data: str, index: int)

Source from the content-addressed store, hash-verified

94 return hash, id
95
96 def __findPlaceholder(self, data: str, index: int) -> tuple[str | None, int]:
97 """
98 Extract id from data string, start from index.
99
100 Arguments:
101 data: String.
102 index: Index, from which we start search.
103
104 Returns:
105 Placeholder id and string index, after the found placeholder.
106
107 """
108 m = self.__placeholder_re.search(data, index)
109 if m:
110 return m.group(1), m.end()
111 else:
112 return None, index + 1
113
114 def __stashNode(self, node: etree.Element | str, type: str) -> str:
115 """ Add node to stash. """

Callers 1

__processPlaceholdersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected