Fix table_filters.js path matching to prevent filters on individual demo pages #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The table filters script was incorrectly injecting filter controls on individual demo pages due to overly broad path matching logic. The original code used
path.indexOf(key)which matched any page containing the configured path substring.Problem
Individual demo pages like
/MASTG/demos/android/MASVS-STORAGE/MASTG-DEMO-0001/were showing filter controls in their code view, when filters should only appear on index pages like/MASTG/demos/.Root Cause
The path matching logic was too permissive:
This caused
/MASTG/demos/android/MASVS-STORAGE/MASTG-DEMO-0001/to match the/MASTG/demos/configuration since it contains that substring.Solution
Implemented precise path matching that only targets actual index pages:
Results
/MASTG/demos/→ Filters shown (correct)/MASTG/demos/android/MASVS-STORAGE/MASTG-DEMO-0001/→ No filters (fixed!)The fix was validated with comprehensive testing covering 20+ edge cases including trailing slashes, index variations, and similar path names.
Fixes #16.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/search/issues/usr/bin/python /home/REDACTED/.local/bin/mkdocs build --config-file mkdocs.yml(http block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.