Properly render Markdown with components and attributes syntax on GitHub.
A browser extension (Chrome, Firefox) that fixes GitHub’s rendering of Markdown files written with Comark syntax — components, attributes, spans and bindings.
GitHub’s Markdown renderer does not understand the Comark extensions: block components leak as plain paragraphs or broken headings, attribute groups show up as stray braces, and mdc code fences stay unhighlighted. With this extension installed, those files become readable again.
Not on the extension stores yet. Grab the latest pack from the releases page:
extension.zip and unzip it.chrome://extensions and turn on Developer mode (top right).extension.xpi.about:debugging#/runtime/this-firefox..xpi file.Firefox removes temporary add-ons on restart. A signed listing on addons.mozilla.org will remove this limitation.
Then open a Comark-flavored Markdown file on GitHub, for example docs/content/index.md from the comark repo.
On github.com, for READMEs and .md blob previews:
raw.githubusercontent.com) and scans it. Plain Markdown files are left untouched.@comark/html, replacing GitHub’s lossy rendering.::card … ::) become syntax-highlighted code blocks of their original source, YAML props included, with a component-name badge.:badge[New]{color="blue"}), attribute groups (**bold**{.accent}), spans ([text]{.mark}) and bindings ({{ user.name }}) become highlighted inline code.```mdc / ```comark fences, which GitHub leaves plain. On non-Comark pages, mdc fences are highlighted in place without touching anything else.Everything follows GitHub’s light, dark and auto color modes.
security plugin: <script>/<iframe>-style tags are dropped, event-handler attributes are stripped, and javascript: URLs are not rendered.example.com without a protocol) are not auto-linked, since linkify would mangle {{ dotted.path }} bindings.pnpm i
pnpm dev
Then load the extension/ folder in your browser (Chrome: chrome://extensions → Developer mode → Load unpacked).
For Firefox:
pnpm dev-firefox
pnpm start:firefox
Good pages to test on:
pnpm test # vitest — scanner, renderer and DOM transform (real GitHub fixtures)
pnpm typecheck
pnpm lint
pnpm build
Then pack the files under extension/: pnpm pack:zip, pnpm pack:crx or pnpm pack:xpi.
src/contentScripts/comark/ - the core logic
github.ts - page detection, raw source fetching, soft-navigation handlingscanner.ts - regex scan of the raw source (Comark syntax gate + inline fragments)renderer.ts - full Comark HTML rendering with component/span handlerstransform.ts - DOM replacement, inline code wrapping, fence highlightinghighlight.ts - rangi wrappers with the Comark grammarstyle.css - injected styles, mapped to GitHub’s CSS variablessrc/popup/ - the enable/disable popupsrc/manifest.ts - the extension manifest (generated to extension/manifest.json)src/tests/ - vitest specs with real GitHub HTML fixturescomark and @comark/html are currently installed from pkg.pr.new builds of comarkdown/comark#352. Switch to the npm releases once the PR ships.Built on vitesse-webext by Anthony Fu — Vite-powered WebExtension starter with Vue 3, HMR and dynamic manifest.