added doc comments to all formatters

This commit is contained in:
truePhilipp committed 2024-05-07 17:36:54 +02:00
1 parent 5fc200a75b
commit cf55e8952b
12 files changed
+197 -4

No files matched your search

@@ -1,3 +1,15 @@
"""
remove_default_formatter.py
This module contains a function `format` that modifies a BeautifulSoup object in place.
The function searches for the "html" element with the attribute "dj-remove-default". If such an element is found,
the function removes the Doctype, "head" element, and "script" element within the "body" element from the BeautifulSoup
object. It also unwraps the "body" and "html" elements, leaving only the remaining content of the "body" element.
Example:
If the html is <!DOCTYPE html><html dj-remove-default><head></head><body><script></script>Content</body></html>,
after processing, it becomes Content.
"""
from bs4 import BeautifulSoup, Doctype, Tag