bevacqua / woofmark

:dog2: Barking up the DOM tree. A modular, progressive, and beautiful Markdown and HTML editor
https://bevacqua.github.io/woofmark
MIT License
1.62k stars 74 forks source link

*ashamed* I don't get the original textarea to sync with woofmark #22

Closed CanRau closed 8 years ago

CanRau commented 8 years ago

Hola, I just stumbled over woofmark last night, and so far I like it.

But I can't figure out how to sync those. I mean, when submitting the form, nothing get posted..? This is my js to init woofmark..

var rte = document.querySelector('.rich-text');
    woofmark(rte, {
        parseMarkdown: megamark,
        parseHTML: domador,
        defaultMode: 'wysiwyg'
    });

Use case, I want to provide an easy (wysiwyg) forum input but behind the scenes everything should be markdown. Do I need parseMarkdown and parseHTML for this? Maybe I should learn more vanilla-js..

Saludos, Can

bevacqua commented 8 years ago

you need to read from woofmark. Do var foo = woofmark(rte, ...) and then foo.value() will always return markdown

CanRau commented 8 years ago

Thank you :)