Page MenuHomePhabricator

When __INDEX__ and __NOINDEX__ both occur, the last one in the source should win
Closed, DeclinedPublic

Description

Author: ayg

Description:
Currently (r37973) when INDEX and NOINDEX both occur on the page, the page is indexable, regardless of the order or the number of times they appear. This is because in line 3386 of Parser.php, I only check whether $this->mDoubleUnderscores has the appropriate indexes. By this point we don't know which one came first. It wasn't immediately obvious to me how best to fix it -- how do NOTOC and FORCETOC work? It's not a big thing, so I figured it didn't need to block the new feature.


Version: unspecified
Severity: minor

Details

Reference
bz14899

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:13 PM
bzimport set Reference to bz14899.
bzimport added a subscriber: Unknown Object (MLST).

I'm not sure why you think this is worth doing. The resulting code would be quite a bit more complicated.

ayg wrote:

It seems to me that the current way of doing it is less intuitive. I would certainly expect the last one in the page to win. If it's complicated to do this with our current setup (and you would know that better than I), I guess it's not worth doing in the foreseeable future.

It seems NOTOC and FORCETOC work the same, at a glance, with FORCETOC always overriding NOTOC. It would be nice if some mechanism could be added to get this to work more nicely, but there are probably better things to do, yeah. Don't see any reason to close the bug, though.