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",
"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)