Skip to content

Unexpected content warning #1

@isosphere

Description

@isosphere

https://oceanplayground.social/@news_unlisted/109349123070354334

This post was given a content warning of "Death", which is configured this way:

[[content_warnings]]
label = "Death"
phrases = [
    "murder", "killing", "death", "suicide", "die", "kill", "killed", 
    "fatal", "genocide", "shooting", "human remains", "homicide"
]

Titles and descriptions are searched using case-insenitive regex matching within word boundaries (\b). an s is optional for all words, it's a lazy way of matching plural forms. 1

mastodon-rss/src/lib.rs

Lines 27 to 28 in 3232c9e

let re = Regex::new(&format!(r"(?i)\b{}s?\b", phrase)).unwrap();
let phrase_found = re.is_match(title) || re.is_match(description);

Here's the text of the description + title:

Source: CBC #news #novascotia

Under fire over claims of political interference, Lucki calls for new rules on #rcmp's relationship with Ottawa

#rcmp Commissioner Brenda Lucki says it's time to bring in better guardrails between the national police force and the federal government to avoid future allegations of political interference.

Footnotes

  1. maybe that's what's doing it? the s? might match the whole word, so then we're just matching consequitive word boundaries. nope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions