Skip to content

fix: add #main to ENTRY_POINT_ELEMENTS#307

Open
cehbz wants to merge 1 commit into
kepano:mainfrom
cehbz:fix/add-main-id-entry-point
Open

fix: add #main to ENTRY_POINT_ELEMENTS#307
cehbz wants to merge 1 commit into
kepano:mainfrom
cehbz:fix/add-main-id-entry-point

Conversation

@cehbz

@cehbz cehbz commented Jun 8, 2026

Copy link
Copy Markdown

Summary

  • Adds '#main' to ENTRY_POINT_ELEMENTS in src/constants.ts,
    grouped with the existing 'main' and '[role="main"]' selectors
  • The existing 'main' entry only matches <main> elements — it does
    not match <div id="main">
  • Without '#main', pages using id="main" fall through to
    lower-priority selectors like '#content', which on some pages
    matches a footer or navigation container

Reproduction

The fixture is from thailand.embassy.gov.au, which uses:

  • <div class="col-md-9" id="main"> for the actual passport
    application content
  • <footer><div id="content" class="container"> for site-wide
    navigation links

Before this fix, Defuddle selected footer > div#content via the
#content entry point and extracted only navigation boilerplate.
With #main added, Defuddle correctly identifies div#main as the
content container.

Test plan

  • New fixture entry-point--id-main confirms correct extraction
  • Full test suite passes (309 tests, 0 failures)
  • No changes to existing expected outputs

'main' matches <main> elements but not id="main". Pages with
<div id="main"> as the content container can fail to match,
resulting in spurious matches of unrelated elements.

Groups #main with main and [role="main"]. Adds regression fixture
from thailand.embassy.gov.au.
@kepano

kepano commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Which site does this affect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants