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

Method handle_tag

crawl4ai/utils.py:201–223  ·  view source on GitHub ↗
(self, tag, attrs, start)

Source from the content-addressed store, hash-verified

199
200
201 def handle_tag(self, tag, attrs, start):
202 if tag == 'pre':
203 if start:
204 self.o('```\n')
205 self.inside_pre = True
206 else:
207 self.o('\n```')
208 self.inside_pre = False
209 elif tag in ["h1", "h2", "h3", "h4", "h5", "h6"]:
210 pass
211
212
213 # elif tag == 'code' and not self.inside_pre:
214 # if start:
215 # if not self.inside_pre:
216 # self.o('`')
217 # self.inside_code = True
218 # else:
219 # if not self.inside_pre:
220 # self.o('`')
221 # self.inside_code = False
222
223 super().handle_tag(tag, attrs, start)
224
225def replace_inline_tags(soup, tags, only_text=False):
226 tag_replacements = {

Callers

nothing calls this directly

Calls 1

oMethod · 0.80

Tested by

no test coverage detected