MCPcopy Index your code
hub / github.com/unclecode/crawl4ai / handle_entityref

Method handle_entityref

crawl4ai/html2text/__init__.py:191–201  ·  view source on GitHub ↗
(self, c: str)

Source from the content-addressed store, hash-verified

189 self.handle_data(self.charref(c), True)
190
191 def handle_entityref(self, c: str) -> None:
192 ref = self.entityref(c)
193
194 # ref may be an empty string (e.g. for ‎/‏ markers that should
195 # not contribute to the final output).
196 # self.handle_data cannot handle a zero-length string right after a
197 # stressed tag or mid-text within a stressed tag (text get split and
198 # self.stressed/self.preceding_stressed gets switched after the first
199 # part of that text).
200 if ref:
201 self.handle_data(ref, True)
202
203 def handle_starttag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]) -> None:
204 self.handle_tag(tag, dict(attrs), start=True)

Callers

nothing calls this directly

Calls 2

entityrefMethod · 0.95
handle_dataMethod · 0.95

Tested by

no test coverage detected