feat: handle <code> tags as code blocks (#1320)

handle <code> tags as code blocks

Signed-off-by: FernandoSSI <fernandosi2005@gmail.com>
This commit is contained in:
Fernando Santos 2025-04-08 05:32:06 -03:00 committed by GitHub
parent 2e99e5a54f
commit 0499cd1c1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,7 @@ TAGS_FOR_NODE_ITEMS: Final = [
"h6", "h6",
"p", "p",
"pre", "pre",
"code",
"ul", "ul",
"ol", "ol",
"li", "li",
@ -165,7 +166,7 @@ class HTMLDocumentBackend(DeclarativeDocumentBackend):
self.handle_header(tag, doc) self.handle_header(tag, doc)
elif tag.name in ["p"]: elif tag.name in ["p"]:
self.handle_paragraph(tag, doc) self.handle_paragraph(tag, doc)
elif tag.name in ["pre"]: elif tag.name in ["pre", "code"]:
self.handle_code(tag, doc) self.handle_code(tag, doc)
elif tag.name in ["ul", "ol"]: elif tag.name in ["ul", "ol"]:
self.handle_list(tag, doc) self.handle_list(tag, doc)