MCPcopy
hub / github.com/unclecode/crawl4ai / beautify_html

Function beautify_html

crawl4ai/utils.py:69–86  ·  view source on GitHub ↗

Beautifies an escaped HTML string. Parameters: escaped_html (str): A string containing escaped HTML. Returns: str: A beautifully formatted HTML string.

(escaped_html)

Source from the content-addressed store, hash-verified

67 return home_folder
68
69def beautify_html(escaped_html):
70 """
71 Beautifies an escaped HTML string.
72
73 Parameters:
74 escaped_html (str): A string containing escaped HTML.
75
76 Returns:
77 str: A beautifully formatted HTML string.
78 """
79 # Unescape the HTML string
80 unescaped_html = html.unescape(escaped_html)
81
82 # Use BeautifulSoup to parse and prettify the HTML
83 soup = BeautifulSoup(unescaped_html, 'html.parser')
84 pretty_html = soup.prettify()
85
86 return pretty_html
87
88def split_and_parse_json_objects(json_string):
89 """

Callers 1

run_oldMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…