wagtail-livepreview icon indicating copy to clipboard operation
wagtail-livepreview copied to clipboard

Live preview is removing script tags

Open jkevingutierrez opened this issue 4 years ago • 1 comments

Livepreview is removing all the script tags in the generated HTML. (https://github.com/KalobTaulien/wagtail-livepreview/blob/master/livepreview/static/livepreview/js/livepreview_fe.js#L4)

Javascript could be used to position elements, to apply CSS styles, to add lazy loading, etc. Removing all the scripts from the page could greatly affect the view of the page (even for simple sites that don't use any JS framework).

It would be great to stop removing all the script tags in the HTML, as this can affect the preview of the pages.

Maybe the stripScripts function should only remove the scripts inside the div with the class js-livepreview-script?

jkevingutierrez avatar Aug 05 '20 20:08 jkevingutierrez

The same issue, anyone resolves this?

urmauur avatar May 05 '21 06:05 urmauur