Skip to content

Commit b67064b

Browse files
codingjoeCopilot
andauthored
Update s3file/forms.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c66a077 commit b67064b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

s3file/forms.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ def handle_startendtag(self, tag, attrs):
5151
else:
5252
self.output.append(self.get_starttag_text())
5353

54+
def handle_comment(self, data):
55+
# Preserve HTML comments in the output
56+
self.output.append(f"<!--{data}-->")
57+
58+
def handle_decl(self, decl):
59+
# Preserve declarations such as <!DOCTYPE ...> in the output
60+
self.output.append(f"<!{decl}>")
61+
62+
def handle_pi(self, data):
63+
# Preserve processing instructions such as <?xml ...?> in the output
64+
self.output.append(f"<?{data}>")
5465
def get_html(self):
5566
return "".join(self.output)
5667

0 commit comments

Comments
 (0)