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
This commit is contained in:
parent
412db6a216
commit
63edb309f8
1 changed files with 482 additions and 8 deletions
|
|
@ -195,16 +195,19 @@ SAFE_CLASSES = {
|
|||
"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)?$"
|
||||
|
|
|
|||
Loading…
Reference in a new issue