Add JS rendering and lighthtml output format support#32
Merged
simonediroma merged 2 commits intoApr 8, 2026
Conversation
… negotiation use case Add documentation for two recently shipped features (render_js via Playwright and lighthtml output format) across the Features table, YAML reference, Tool API, and response summary example. Add a new use case showing how to leverage Cloudflare's "Markdown for Agents" Accept: text/markdown content negotiation to get LLM-ready Markdown directly from the edge. https://claude.ai/code/session_01HfKd1qWzkoJqxnVAPfNFmA
mypy reports that BeautifulSoup's tag.get() returns str | AttributeValueList, which has no .lower(). Wrapping with str() resolves the union-attr error on line 829. https://claude.ai/code/session_01HfKd1qWzkoJqxnVAPfNFmA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds JavaScript rendering capabilities via Playwright and introduces a new
lighthtmloutput format for minimal HTML output. These features enable better handling of JavaScript-heavy websites and provide a lightweight HTML extraction option.Key Changes
render_jsconfiguration option (global, per-domain, and per-call) to render pages with headless Chromium before content extraction. Requires optional Playwright dependency.<style>,<script>tags (except JSON-LD), HTML comments, and all tag attributes to return minimal bare HTML structure.render_jsto global configuration schema with defaultfalserender_jsparameter to per-call API documentationoutput_formatdescriptions to includelighthtmloptionJS renderingfield to the structured response summary to indicate whether JS rendering was appliedImplementation Details
https://claude.ai/code/session_01HfKd1qWzkoJqxnVAPfNFmA