]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/entirely_negated_pagespec_matches_internal_pages.mdwn
trivial bug with patch
[ikiwiki.git] / doc / bugs / entirely_negated_pagespec_matches_internal_pages.mdwn
1 A [[PageSpec]] that is entirely negated terminals, such as "!foo and !bar"
2 matches all other pages, including all internal pages. This can lead to
3 unexpected results, since it will match a bunch of recentchanges pages,
4 etc.
5
6 Recall that internal-use pages are not matched by a glob. So "*" doesn't
7 match them. So if the pagespec is "* and !foo and !bar", it won't match
8 them. This is the much more common style.
9
10 There's an odd inconsistency with entirely negated pagespecs. If "!foo"
11 matches page bar, shouldn't "" also match bar? But, the empty pagespec is
12 actually special-cased to not match anything.
13
14 Indeed, it seems what would be best would be for "!foo" to not match any
15 pages, unless it's combined with a terminal that positively matches pages
16 ("* and !foo"). Although this would be a behavior change, with transition
17 issues.
18
19 Another approach would be to try to detect the case of an entirely negated
20 pagespec, and implicitly add "and !internal()" to it.
21
22 Either approach would require fully parsing the pagespec. And consider cases
23 like "!(foo and !bar)". Doesn't seem at all easy to solve. --[[Joey]]