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

Embedding a script (e.g. tweet) in a page block breaks the json rendering in edit mode #208

Closed
HeyJoel opened this Issue May 11, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@HeyJoel
Copy link
Member

HeyJoel commented May 11, 2018

Extracted from #202

It's possible to use a [MultiLineText] annotation on a string property to create a page block that can accept raw html, however when editing a page that contains the raw html containing a js snippet (e.g. an embedded tweet) the json page data appears at the bottom of the page. This is because the script somehow breaks the rendering of the page data to json. This only appears when logged into the admin panel, since the data is only rendered for the visual editor.

The code responsible for this is in VisualEditorActionResult.CreateResponseJson

@HeyJoel HeyJoel added the bug label May 11, 2018

@HeyJoel HeyJoel added this to the 0.3.2 milestone May 11, 2018

HeyJoel added a commit that referenced this issue May 17, 2018

@HeyJoel

This comment has been minimized.

Copy link
Member

HeyJoel commented May 17, 2018

Fixed by using StringEscapeHandling.EscapeHtml in the json settings when redering the model.

@HeyJoel HeyJoel closed this May 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment