feat(pwa): rendered Markdown view toggle (closes #23)#25
Merged
Conversation
Adds a Raw | Rendered segmented toggle in the result header so users can view fetched output as formatted HTML alongside the existing raw source. Raw remains the default; selection persists in localStorage. - Self-hosted marked v12.0.2 + DOMPurify v3.4.2 under public/vendor/ so the PWA works offline. - Lazy first-render: rendered DOM is only built when the user first switches to Rendered for a given result. - Sanitization config strips scripts, inline styles, event handlers, and javascript: URLs; rendered links open in a new tab with rel="noopener noreferrer". - Both themes (dark + paper) styled via existing CSS variables. - Copy button still copies the raw Markdown source regardless of active view. - Service Worker precaches the new vendor files; CACHE_NAME bumped to pullmd-v20. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Raw | Renderedsegmented toggle in the result header so users can view the fetched output as formatted HTML alongside the existing raw source.localStorageunderpullmd-view-mode.javascript:URLs.rel="noopener noreferrer".public/sw.js) precaches the new vendor files so the rendered view works offline in the installed PWA.CACHE_NAMEbumped topullmd-v20.Closes #23. Bumps
package.jsonto 2.4.0.Out of scope (deferred)
/s/:idshare links (still returns puretext/markdown)Test plan
localStoragepersistence: reload page, last mode restored<script>,<img onerror>,[link](javascript:)payloads neutralizedrel="noopener noreferrer"node --teststill passes (no server-side changes; 558/558 locally)🤖 Generated with Claude Code