From 0499cd1c1e93f74260754476a8423059915f59c2 Mon Sep 17 00:00:00 2001 From: Fernando Santos <121275806+FernandoSSI@users.noreply.github.com> Date: Tue, 8 Apr 2025 05:32:06 -0300 Subject: [PATCH] feat: handle tags as code blocks (#1320) handle tags as code blocks Signed-off-by: FernandoSSI --- docling/backend/html_backend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docling/backend/html_backend.py b/docling/backend/html_backend.py index 943592a..5889429 100644 --- a/docling/backend/html_backend.py +++ b/docling/backend/html_backend.py @@ -34,6 +34,7 @@ TAGS_FOR_NODE_ITEMS: Final = [ "h6", "p", "pre", + "code", "ul", "ol", "li", @@ -165,7 +166,7 @@ class HTMLDocumentBackend(DeclarativeDocumentBackend): self.handle_header(tag, doc) elif tag.name in ["p"]: self.handle_paragraph(tag, doc) - elif tag.name in ["pre"]: + elif tag.name in ["pre", "code"]: self.handle_code(tag, doc) elif tag.name in ["ul", "ol"]: self.handle_list(tag, doc)