Skip to content

Commit d6a157a

Browse files
committed
fix: update flow chart
1 parent 8178b1d commit d6a157a

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

content/pages/api/match.png

-39.4 KB
Binary file not shown.

content/pages/api/matching.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,44 @@ Here is the long version:
8989
- If no `@match` rule is defined, we fallback to `@include` rules and the script matches only if some of the `@include` rules match.
9090
- If neither `@match` nor `@include` rule is defined, the script is assumed to match.
9191

92-
![match.png](match.png)
92+
```mermaid
93+
graph TD
94+
Start([A script]) --> D1{ }
95+
96+
%% Exclude Match Decision
97+
D1 -- "Any `@exclude-match` rule matches?" --> D1_Result{ }
98+
D1_Result -- Yes --> Unmatch
99+
D1_Result -- No --> D2
100+
101+
%% Exclude Decision
102+
D2{ } -- "Any `@exclude` rule matches?" --> D2_Result{ }
103+
D2_Result -- Yes --> Unmatch
104+
D2_Result -- No --> D3
105+
106+
%% Match Defined Decision
107+
D3{ } -- "Any `@match` rule defined?" --> D3_Result{ }
108+
109+
%% Path: Match is defined
110+
D3_Result -- Yes --> D4{ }
111+
D4 -- "Any `@match` rule matches?" --> D4_Result{ }
112+
D4_Result -- Yes --> Match
113+
D4_Result -- No --> Unmatch
114+
115+
%% Path: Match is NOT defined
116+
D3_Result -- No --> D5{ }
117+
D5 -- "Any `@include` rule defined?" --> D5_Result{ }
118+
119+
D5_Result -- No --> Match
120+
D5_Result -- Yes --> D6{ }
121+
122+
D6 -- "Any `@include` rule matches?" --> D6_Result{ }
123+
D6_Result -- Yes --> Match
124+
D6_Result -- No --> Unmatch
125+
126+
%% Final Nodes
127+
Match["Match<br/>(should execute)"]
128+
Unmatch["Unmatch<br/>(should not execute)"]
129+
```
93130

94131
Matching SPA sites like fb, github, twitter, youtube
95132
---

0 commit comments

Comments
 (0)