Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz a36c86c90c fix: exclude-selectors matches are excluded entirely, not just ignored
--exclude-selectors marked a match as "ignored", the same as a bare
data-pagefind-ignore, so metadata and filters inside the match were still
collected. Excluding img.emoji, for example, still let the emoji become the
page's auto-detected image.

The status was also applied after the element had been processed. For a void
element such as <img> that is too late twice over: its metadata has already
been read, and the parser has already popped back to the parent, so the
status landed on the parent instead and wiped out the rest of the page.

Match the selectors in a handler registered ahead of the main element
handler, which now reads that flag and gives the node Excluded status up
front. The built-in REMOVE_SELECTORS (head, nav, footer, ...) keep the old
Ignored status, so metadata tagged inside them still counts.

Fixes #692
2026-09-13 15:31:49 +02:00
upstream 5205bba40d Upstream Pagefind/pagefind state of the touched files before bd9ded0754 2026-09-11 23:13:08 +02:00
dualfroz 0428cf7195 fix(pagefind): skip exclude selectors that cannot be parsed
Every --exclude-selectors value was joined into a single selector string
handed to lol_html, so one selector the parser does not support took the
whole run down with an unwrap panic. Selectors are now validated one by
one and unsupported ones are reported through the logger and dropped.

Fixes #931
2026-09-10 08:42:44 +02:00
upstream c1c5f2ad73 Upstream Pagefind/pagefind state of the touched files before e139c4741e 2026-09-10 08:42:44 +02:00