feat(core): add more file extensions to ignore in HTML link extraction #34552
+6
−0
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.
feat(core): add more file extensions to ignore in HTML link extraction
Description
This PR enhances the HTML link extraction utility in
libs/core/langchain_core/utils/html.pyby expanding theSUFFIXES_TO_IGNORElist to include additional common binary file extensions:.webp.pdf.docx.xlsx.pptx.pptmThese file types are non-HTML, non-crawlable resources. Ignoring them prevents
find_all_linksandextract_sub_linksfrom mistakenly treating such binary assets as navigable links. This improves link filtering, reduces unnecessary crawling, and aligns behavior with typical web scraping expectations.Summary of Changes
libs/core/langchain_core/utils/html.py: Added.webp,.pdf,.docx,.xlsx,.pptx,.pptmtoSUFFIXES_TO_IGNORE.Related Issues
N/A
Verification
ruff check libs/core/langchain_core/utils/html.py: Passedmypy libs/core/langchain_core/utils/html.py: Passedpytest libs/core/tests/unit_tests/utils/test_html.py: Passed (11 tests)