-
Notifications
You must be signed in to change notification settings - Fork 29
Trim links and include images #2011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for content-scope-scripts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Temporary Branch UpdateThe temporary branch has been updated with the latest changes. Below are the details:
Please use the above install command to update to the latest version. |
[Beta] Generated file diffTime updated: Thu, 16 Oct 2025 01:47:38 GMT Apple
File has changed Integration
File has changed Windows
File has changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
I tested this by npm link
ing into macOS and browsing to nba.com. I didn’t see [](/)
in the chat history like I did when testing without this branch.
Now that this code is getting closer to landing in production we should think about tests. Snapshot tests (e.g. toMatchInlineSnapshot()
) at the domToMarkdown
level would be a great cost vs. benefit imo.
Yeah agreed, I'll be doing that once back I already scoped: https://app.asana.com/1/137249556945/project/72649045549333/task/1211654081298449?focus=true If I get time before I will address. |
Refactor image rendering to use getAttributeOrBlank for safer attribute retrieval.
Clarified whitespace handling comments in the code.
Added a comment explaining the disabling of images in excluded inert elements.
Clarify comment regarding image handling in excluded inert elements.
d8e91ea
to
ce3c984
Compare
7e889be
to
86a6039
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/72649045549333/task/1211632579258684?focus=true
Description
Testing Steps
Checklist
Please tick all that apply:
Note
Enhances DOM-to-Markdown (images, link trimming, ol/ul parity), hardens iframe access, adds body fallback, and introduces jsdom-based tests with fixtures.
checkNodeIsVisible
anddomToMarkdown
; addtrimBlankLinks
and allowexcludeSelectors
to benull
.img
to markdown and treatol
likeul
; improveli
formatting viacollapseAndTrim
.getAttributeOrBlank
helper.getSameOriginIframeDocument
to avoid security errors; only include same-origin content when allowed.img
to excluded inert elements by default; introduce body fallback (bodyFallback
) when main content is too short/empty.trimBlankLinks
andincludeIframes
flags; improved logging.page-context-dom.spec.js
usingjsdom
with fixtures and expected markdown outputs..gitignore
.jsdom
as a dev dependency; update lockfile.Written by Cursor Bugbot for commit 047130f. This will update automatically on new commits. Configure here.