Skip to content

View raw markdown source per tab - #25

Merged
sorenwacker merged 2 commits into
mainfrom
feature/source-view
Jun 19, 2026
Merged

sorenwacker merged 2 commits into
mainfrom
feature/source-view

Conversation

@sorenwacker

Copy link
Copy Markdown
Owner

Why

Readers sometimes need the literal markdown behind a rendered document — to inspect syntax, copy a snippet, or check exact formatting. This adds an in-app toggle between the rendered view and the raw source, remembered independently per tab.

What

  • New modules/source-view.js owns the toggle button (icon/title/active state) and the toggle action.
  • renderActiveTabContent in tabs.js becomes the single place that writes #markdownContent, so tab switches, reloads, file-watch updates, and the source toggle all render through one consistent path.
  • Raw markdown is inserted via textContent (never markup) so it shows verbatim and cannot inject HTML.
  • Per-tab sourceView state; Cmd/Ctrl+Shift+S shortcut; toggle button shown only when a document is open.
  • README and docs updated; source styling reuses the code-block frame with wrapping for readability.

Tests

5 new Playwright specs in tests/source-view.spec.js (toggle, round-trip, shortcut, per-tab memory, hidden-until-open). Full suite: 30 passing.

@sorenwacker
sorenwacker merged commit 3b8c7cb into main Jun 19, 2026
1 check passed
@sorenwacker
sorenwacker deleted the feature/source-view branch June 19, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant