MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / handle_code

Method handle_code

docling/backend/html_backend.py:211–219  ·  view source on GitHub ↗

Handles monospace code snippets (pre).

(self, element: Tag, idx: int, doc: DoclingDocument)

Source from the content-addressed store, hash-verified

209 )
210
211 def handle_code(self, element: Tag, idx: int, doc: DoclingDocument):
212 """Handles monospace code snippets (pre)."""
213 if element.text is None:
214 return
215 text = element.text.strip()
216 label = DocItemLabel.CODE
217 if len(text) == 0:
218 return
219 doc.add_code(parent=self.parents[self.level], text=text)
220
221 def handle_paragraph(self, element: Tag, idx: int, doc: DoclingDocument):
222 """Handles paragraph tags (p)."""

Callers 1

analyse_elementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected