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

feat: add new ruleset grammar #490

Merged
merged 36 commits into from
Jun 15, 2024
Merged

feat: add new ruleset grammar #490

merged 36 commits into from
Jun 15, 2024

Conversation

iorate
Copy link
Owner

@iorate iorate commented Jun 15, 2024

This pull request introduces a new grammar of ruleset.

---
name: New grammar example
description: YAML frontmatter is supported.
---

########## String matchers ##########

# Titles which are exactly "Example Domain"
title = "Example Domain"

# Titles which start with "Example"
title ^= "Example"

# Titles which end with "domain", case-insensitive
title $= "domain" i

# Titles which include "ple dom", case-insensitive
title *= "ple dom" i

########## Regular expressions ##########

# URLs which include "example.net" or "example.org"
url =~ /example\.(net|org)/

# "=~" can be omitted
url/example\.(net|org)/

# "url" can be omitted
/example\.(net|org)/

# Titles which include "example domain", case-insensitive
title =~ /example domain/i

########## Logical operators ##########

# Block schemes other than HTTPS
!scheme="https"

# Block Amazon.com on Google
$site = "google" & host = "www.amazon.com"

# Titles including "example" or "domain", case-insensitive
title *= "example" i | title *= "domain" i

########## With match patterns ##########

# Block Amazon.com on image search
*://*.amazon.com/* @if($category="images")

The extension reads the name field in YAML frontmatter. #351 can be closed.

---
name: Your ruleset name
---
*://*.example.com/*
/example\.(net|org)/
title =~ /example domain/i

#422 can also be closed.

*://*.amazon.com/* @if($site="google" & $category="images")

@aug-dev
Copy link
Contributor

aug-dev commented Jun 15, 2024

The legend!

@iorate iorate merged commit 0ca80c9 into master Jun 15, 2024
1 check passed
@iorate iorate deleted the new-grammar branch June 15, 2024 15:31
Copy link

🎉 This PR is included in version 8.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

NotaInutilis added a commit to NotaInutilis/ublacklist-pinterest that referenced this pull request Jul 9, 2024
See iorate/ublacklist#490
- Header replaced by YAML frontmatter
- Regex OVK rule replaced with an expression rule
- New image only OVK list
- Updated readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants