Repository navigation
LaTeX renderer with shareable #fragment links - #354
Merged
Merged
Conversation
Equations render with MathJax 4 (SVG, automatic line breaking on narrow screens); prose and full documents render with faster-latex (Rust compiled to WebAssembly) with their maths re-typeset by MathJax. Links are either readable (#E=mc^2) or compressed (#~1...): raw DEFLATE with a preset dictionary tuned for LaTeX, then base64url. The editor view lives at ?edit#..., the bookmarkable rendered view at #... Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KJrPqqWVHLqr4E7TLPnpt
- DOMPurify now returns a DOM fragment, so sanitized markup is never re-parsed (the route mutation-XSS bypasses take) - Regression tests fire XSS payloads through both renderers and assert nothing runs; removing MathJax's safe extension makes them fail - New Prose and TikZ examples; loading an example over an edited draft asks first, and Back restores the draft - TikZ labels no longer wrap at MathJax's inline line-break points Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KJrPqqWVHLqr4E7TLPnpt
All rendering (MathJax, faster-latex, DOMPurify) now runs in an iframe with sandbox="allow-scripts", like the HTML blocks in the Markdown SVG renderer. Its opaque origin cannot reach this page, cookies or the API keys other tools keep in localStorage. The frame's srcdoc carries a CSP allowing only its inline scripts (hashed at runtime, so they cannot go stale) and the pinned CDN paths; remote images are blocked so links cannot act as tracking pixels. The parent treats every message from the frame as untrusted, opens only http(s) links, and strips exported SVG down to inert markup. New: load LaTeX from a raw URL, a GitHub Gist or a github.com file page, via a form in the editor or ?url= links, which stay short and follow changes to the file. Editing turns it into a local #fragment copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KJrPqqWVHLqr4E7TLPnpt
Deploying tools with
|
| Latest commit: |
b65f44d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6eb0e710.tools-b1q.pages.dev |
| Branch Preview URL: | https://latex-renderer.tools-b1q.pages.dev |
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.
Equations render with MathJax 4 (SVG, automatic line breaking on narrow
screens); prose and full documents render with faster-latex (Rust
compiled to WebAssembly) with their maths re-typeset by MathJax.
Links are either readable (#E=mc^2) or compressed (#~1...): raw DEFLATE
with a preset dictionary tuned for LaTeX, then base64url. The editor
view lives at ?edit#..., the bookmarkable rendered view at #...
Opus 5.5 Extra: https://claude.ai/code/session_017KJrPqqWVHLqr4E7TLPnpt