Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cyan33 opened this issue Aug 8, 2016 · 2 comments

Comments

@cyan33
Copy link

cyan33 commented Aug 8, 2016

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?

@himynameistimli
Copy link

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.

@cyan33
Copy link
Author

cyan33 commented Aug 8, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants