mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 08:15:59 +00:00
Do not overwrite input variable for flexibility
This commit is contained in:
1 parent
a5f586fda2
commit
32a97eb306
1 file changed
+3
-3
@@ -408,15 +408,15 @@ def search_files(
|
||||
return matches
|
||||
|
||||
|
||||
def render_html(text: str) -> str:
|
||||
def render_html(html: str) -> str:
|
||||
"""
|
||||
Remove HTML tags and decode HTML entities from text while preserving the actual content.
|
||||
This keeps type information and structure but removes all formatting.
|
||||
|
||||
:param text: HTML text to clean
|
||||
:param html: HTML text to clean
|
||||
:return: Plain text without HTML tags and with decoded entities
|
||||
"""
|
||||
soup = BeautifulSoup(text, "html.parser")
|
||||
soup = BeautifulSoup(html, "html.parser")
|
||||
# join text with spaces to avoid concatenation of words
|
||||
text = soup.get_text(separator=" ", strip=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user