3 ms·
I want something like this quite badly. However, I'm not sure this is suitable for the users who I want this for (ie, people who don't need to understand markdo
by wvl 15y ago
I want something like this quite badly. However, I'm not sure this is suitable for the users who I want this for (ie, people who don't need to understand markdown formatting)
1. Doing an html to markdown conversion, as you seem to be doing, feels like a giant hack. And one with leaky abstractions to boot (Hit enter off the end of a list, and you get <div></div> inserted into the markdown source).
2. Link editing is super important, and, also a very difficult problem (selection/range management issues) without the html to markdown problem added on top.
I think something like this is doable by having the transformation only happen one way (from markdown to html), given a markdown parser with full access to the parse tree. However, there's many other issues that would arise from doing it that way.
- okal 15y agoI thought the whole appeal would be the fact that it's WYSIWYG. Wouldn't a one way md-to-html transformation preclude that?
- wvl 15y agoI probably didn't explain that well. There are plenty of non wysiwig markdown editors out there. The appeal of this demo is that you're editing the markdown source through a wysiwyg editor. However, with this demo, there are two authoritative sources of content, the html in the contenteditable, and the markdown. I'm arguing that there should only be a single authoritative source of content; and I'd like that to be markdown. I think it's possible, though difficult.
- true_religion 15y agoYou mean like a WYSIWYG editor for markdown? There's pagedown which is used on Stackoverflow.
- bergie 15y agoYou could treat the HTML version as temporary and Markdown as "master". I was considering to do the demo that way - having the original source in the Markdown textarea, and generating the HTML from it before loading the editor.