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

added editor.value() method as both setter and getter #27

Closed jywarren closed 8 years ago

jywarren commented 8 years ago

Followup on using editor.value() to get/set editor content for all three modes in this issue: https://github.com/bevacqua/woofmark/issues/15

Manually tested; i didn't see a test suite but would be happy to add a test if there is one. Thanks!

bevacqua commented 8 years ago

Awesome stuff. I would rather parse the user input. As long as arguments.length === 1, use String(text) to set the value to their input. In case of HTML mode, convert the provided input into HTML by way of parseHTML. Only accepts Markdown (for a simpler API).

Needs docs update

jywarren commented 8 years ago

OK, updated, I think; can you confirm that I've used o.parseHTML(text) correctly? This would still allow setting the raw HTML in html mode, but only because we haven't disallowed it. I updated the docs too.

Thanks!

bevacqua commented 8 years ago

See b3f25451c0c940a6477417fba13241795f089c43