Mercurial > libervia-backend
diff libervia/backend/plugins/plugin_misc_text_syntaxes.py @ 4399:fe09446a09ce
component email message: Mailing list messages cleaning:
For mailing-list messages:
- convert all text-only messages to XHTML for consistency.
- detect and flag "noisy" content, i.e. content which are not useful and annoying in
forum-like view (full-lenght quoted previous messages, mailing-list signature)
rel 464
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 11 Sep 2025 21:17:47 +0200 |
parents | 33468e175ade |
children |
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_misc_text_syntaxes.py Thu Sep 11 21:10:35 2025 +0200 +++ b/libervia/backend/plugins/plugin_misc_text_syntaxes.py Thu Sep 11 21:17:47 2025 +0200 @@ -195,16 +195,19 @@ "vm", "w", "write", + # "noise" class is used by gateways (in particular email gateway) to mark annoying and + # not useful content. + "noise" } STYLES_VALUES_REGEX = ( - r"^(" + "^(" + "|".join( [ - "([a-z-]+)", # alphabetical names - "(#[0-9a-f]+)", # hex value - "(\d+(.\d+)? *(|%|em|ex|px|in|cm|mm|pt|pc))", # values with units (or not) - "rgb\( *((\d+(.\d+)?), *){2}(\d+(.\d+)?) *\)", # rgb function - "rgba\( *((\d+(.\d+)?), *){3}(\d+(.\d+)?) *\)", # rgba function + r"([a-z-]+)", # alphabetical names + r"(#[0-9a-f]+)", # hex value + r"(\d+(.\d+)? *(|%|em|ex|px|in|cm|mm|pt|pc))", # values with units (or not) + r"rgb\( *((\d+(.\d+)?), *){2}(\d+(.\d+)?) *\)", # rgb function + r"rgba\( *((\d+(.\d+)?), *){3}(\d+(.\d+)?) *\)", # rgba function ] ) + ") *(!important)?$"