MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / attrIndex

Method attrIndex

markdown_it/token.py:80–87  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

78 self.attrs = convert_attrs(self.attrs)
79
80 def attrIndex(self, name: str) -> int:
81 warnings.warn( # noqa: B028
82 "Token.attrIndex should not be used, since Token.attrs is a dictionary",
83 UserWarning,
84 )
85 if name not in self.attrs:
86 return -1
87 return list(self.attrs.keys()).index(name)
88
89 def attrItems(self) -> list[tuple[str, str | int | float]]:
90 """Get (key, value) list of attrs."""

Callers 1

test_tokenFunction · 0.95

Calls

no outgoing calls

Tested by 1

test_tokenFunction · 0.76