angular-medium-editor icon indicating copy to clipboard operation
angular-medium-editor copied to clipboard

when I hit 'send', the content of the textarea will be automatically converted to HTML tags.

Open cyan33 opened this issue 9 years ago • 2 comments
trafficstars

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?

cyan33 avatar Aug 08 '16 02:08 cyan33

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.

himynameistimli avatar Aug 08 '16 03:08 himynameistimli

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!

cyan33 avatar Aug 08 '16 07:08 cyan33