comparison libervia/backend/plugins/plugin_misc_text_syntaxes.py @ 4258:ba28ca268f4a

plugin text syntaxes: fix empty string handling in `_remove_markups`.
author Goffi <goffi@goffi.org>
date Wed, 05 Jun 2024 22:33:37 +0200
parents 26b7ed2817da
children 0d7bb4df2343
comparison
equal deleted inserted replaced
4257:810f2b80146b 4258:ba28ca268f4a
473 473
474 @param xhtml: the XHTML string to be cleaned 474 @param xhtml: the XHTML string to be cleaned
475 @return: the cleaned string 475 @return: the cleaned string
476 """ 476 """
477 cleaner = clean.Cleaner(kill_tags=["style"]) 477 cleaner = clean.Cleaner(kill_tags=["style"])
478 if not xhtml:
479 return ""
478 cleaned = cleaner.clean_html(html.fromstring(xhtml)) 480 cleaned = cleaner.clean_html(html.fromstring(xhtml))
479 return html.tostring(cleaned, encoding=str, method="text") 481 return html.tostring(cleaned, encoding=str, method="text")