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

escape html characters when converting text node to HTML #2446

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

mcammisa
Copy link
Contributor

@mcammisa mcammisa commented Dec 6, 2019

When converting templates to HTML using the component.toHTML() function special characters are not escaped. This produces badly formed HTML.

Steps to reproduce:

  1. Go to https://grapesjs.com/demo.html
  2. Enter < into a text field
  3. In the dev console run the command window.grapesjs.editors[0].getHtml()

Expected Output:
Properly formed HTML with < character escaped

Actual Output:
< character left untouched and broken HTML

Please let me know if I missed anything here.

Keep up the great work!

@artf
Copy link
Member

artf commented Dec 9, 2019

Great, thank you very much Matias ❤️

@artf artf merged commit d63131f into GrapesJS:dev Dec 9, 2019
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

Successfully merging this pull request may close these issues.

2 participants