Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples to advanced content filter #1024

Merged
merged 4 commits into from Sep 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion advancedcontentfilter/doc/advancedcontentfilter.md
Expand Up @@ -34,6 +34,14 @@ If the expression using a post variables returns `true`, the post will be collap

A post will be collapsed if at least one rule matches, but all matching rule names will be displayed above the collapsed content.

## Examples

1. To block specific domains `body matches "/\\.example\\.com/"`
2. To block everything that contains the words `body matches "/Guten Morgen/"`
3. To block every occurence of the word facebook with a space in front and after the word `body matches "//s facebook/s /"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's /s? I feel like you're expecting the "any whitespace" character class but it would be \s, and in this case, possibly \\s because of the way we're entering the regular expression.

4. To colapse every post that contains more than 1 image `body matches "/(?:(?:(?:\\[url(?:=.*)?\\])?\\[img(?:=.*)?\\].*\\[\\/img\\]\\s*(?:\\[\\/url\\])?)\\s*){2}/"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: collapse.



## Expression Syntax

### Supported Literals
Expand Down Expand Up @@ -506,4 +514,4 @@ You can also retrieve the variables of a specific post by pasting its URL below
</td>
</tr>
</tbody>
</table>
</table>