angular-medium-editor
angular-medium-editor copied to clipboard
when I hit 'send', the content of the textarea will be automatically converted to HTML tags.
Here is the issue I confront, the editor works well. But when I hit the 'send' button, the content of the textarea will be automatically converted to words wrapped with HTML tags. Like when I write 'Hello world' and hit 'send', the content would be '< p >Hello world< / p >' before it is actually sent. Is there any possible solution?
Are you looking to get just plaintext output of your content or are you asking to output the rendered version of you content?
If plain text you could try getting the element and outputting the textContent or using regex (not advised) to filter tags in a particular way.
If you're looking to render the content on the page you could use ng-bind-html="your-content-object" on the element you want the rendered content to be in. Read thru the doc in the link about sanitization.
The thing is, the textarea already had the 'ng-model' attribute so the 'ng-bind-html' may not work well. Anyway, I've found a tricky way to hide the content wrapped with tags, using 'color: transparent'. Thanks!