MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / evalId

Method evalId

markdown/inlinepatterns.py:904–918  ·  view source on GitHub ↗

Evaluate the id portion of `[ref][id]`. If `[ref][]` use `[ref]`.

(self, data: str, index: int, text: str)

Source from the content-addressed store, hash-verified

902 return self.makeTag(href, title, text), m.start(0), end
903
904 def evalId(self, data: str, index: int, text: str) -> tuple[str | None, int, bool]:
905 """
906 Evaluate the id portion of `[ref][id]`.
907
908 If `[ref][]` use `[ref]`.
909 """
910 m = self.RE_LINK.match(data, pos=index)
911 if not m:
912 return None, index, False
913 else:
914 id = m.group(1).lower()
915 end = m.end(0)
916 if not id:
917 id = text.lower()
918 return id, end, True
919
920 def makeTag(self, href: str, title: str, text: str) -> etree.Element:
921 """ Return an `a` [`Element`][xml.etree.ElementTree.Element]. """

Callers 1

handleMatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected