3 ms·
this looks cool and super easy to add bidirectional HTML <> markdown support similar to the demo i did for redactor-js here: http://leeoniya.github.io/redactor-
by leeoniya 13y ago
this looks cool and super easy to add bidirectional HTML <> markdown support similar to the demo i did for redactor-js here: http://leeoniya.github.io/redactor-js/ http://leeoniya.github.io/redactor-js/
using https://github.com/leeoniya/reMarked.js https://github.com/leeoniya/reMarked.js and https://github.com/chjj/marked https://github.com/chjj/marked
may just have to do this after work today if no one gets to it first.
- yaddayadda 13y agoQuill's WYSIWYG + HTML<->MD bidirectional support (e.g. leeoniya's example) + ShareJS' operational transformation [1] == awesome collaborative JS-ish web editor stack Throw in a ShareJS script to autosave [2], an it's even more awesome! [1] http://sharejs.org/ http://sharejs.org/ [2] https://gist.github.com/josephg/1341527 https://gist.github.com/josephg/1341527 Relevant Githubs: - https://github.com/quilljs/quill https://github.com/quilljs/quill - https://github.com/josephg/ShareJS https://github.com/josephg/ShareJS Edited: to account for leeoniya's explanation that follows
- leeoniya 13y agojust to clarify, Redactor has nothing to do with the bidirectinal support. I implemented it using the listed HTML > markdown and markdown > HTML libs and about 10 lines of code. This support can just as easily be added to any WYSIWYG editor that can bind keyup, and has getHtml() and setHtml() methods. EDIT: and to really come full circle, instead of rendering the markdown in a plain textarea like the example, render it inside of Codemirror with syntax coloring.
- jlu 13y agoIf anyone's interested in two-way markdown/HTML editing, give visual-marks.com a try, it syncs contents both way.