Repository navigation
decap-cms-widget-openmarkdown: a Markdown widget that keeps your source as written #8096
XueyanZhang
started this conversation in
Show and tell
Replies: 1 comment
|
I wrote up the background in more detail: why the stock widget rewrites lines you didn't touch, the full test table, and the two-step setup. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I built a custom widget for Decap that edits the Markdown source directly, with live preview, instead of round-tripping it through a rich-text tree.
The reason: with the stock
markdownwidget, editing one word can reformat other parts of the file (escapes added or dropped,-bullets turned into*, table alignment lost). See #2845, #5673 and #2386. In a git-backed site, that shows up as noisy diffs.What I measured (Decap 3.17.3 + decap-server, changes counted in
git diff):It renders tables (edited cell by cell inside the form), math, Mermaid and callouts as you type. Image paste goes through the media library.
Setup is one script tag after decap-cms.js, plus
widget: openmarkdownin config.yml. (If you bundledecap-cms-app3.17+, it needs React ^19.1.) The file format doesn't change, so you can switch back at any time.npm: https://www.npmjs.com/package/decap-cms-widget-openmarkdown
source: https://github.com/OpenMarkdown-dev/decap-cms-widget-openmarkdown
It's early (0.1.0): there's no toolbar yet, and it's only tested in Chromium. I'd love to hear where it breaks on your content.
Disclosure: I maintain the underlying editor (@openmarkdown-dev/editor, MIT).
All reactions