Skip to content

Repository files navigation

Web Clipper Enhancer

简体中文

Obsidian plugin that improves notes saved by Obsidian Web Clipper. Diagrams first; more clipper-side fixes can land here later.

Background

When you clip a page with the official Web Clipper, Mermaid diagrams are often saved as large inline <svg> blobs. Those SVGs usually lack the site’s CSS, so they render poorly (or not at all) inside Obsidian.

This plugin post-processes those notes in Obsidian: prefer recovering the original Mermaid source so Obsidian can render it natively; if that isn’t possible, fall back to extracting SVGs into asset files and wiki embeds.

What it does

  1. Enhancer: Restore Mermaid from source (recommended)
    Reads the note’s frontmatter source URL, fetches Mermaid from the original page, and replaces inline SVGs with ```mermaid fences.

  2. Enhancer: Extract inline SVGs to assets (fallback)
    Writes .svg files next to the note and replaces them with ![[…]] embeds. Optional local LM Studio naming.

Both actions appear in the command palette and the file context menu (grouped under one menu section, titles prefixed with Enhancer: / 增强:). UI: English / 简体中文 (follows Obsidian’s language).

Install

npm install
npm run build

Copy into your vault:

<vault>/.obsidian/plugins/web-clipper-enhancer/
  main.js
  manifest.json
  styles.css

Enable Web Clipper Enhancer under Community plugins and reload. Use npm run dev while iterating.

Usage

  1. Open a clipped note that contains inline SVGs (ideally with a source: URL).
  2. Run Enhancer: Restore Mermaid from source first.
  3. If the original page has no Mermaid, use Enhancer: Extract inline SVGs.

Optional backup before changes: Note.pre-svg-extract.md.

Settings (summary)

Setting Default Notes
Assets folder assets Where extracted SVGs go
Backup before extract on Writes .pre-svg-extract.md
Embed width 600 ![[file.svg|600]]; 0 omits width
LM Studio on / localhost:1234 SVG naming only; heuristics on failure

Extra

Theme fonts can make restored Mermaid labels look too wide. See Mermaid font CSS for an optional vault CSS snippet.

License

MIT

About

Obsidian plugin that enhances notes from Obsidian Web Clipper (Mermaid restore, SVG extract, and more).

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages