Animated SVGs and Layout Builder

Created on 14 March 2022, almost 3 years ago
Updated 20 February 2023, almost 2 years ago

Problem/Motivation

When embedding an animated and unsanitized SVG image in layout builder, we are no longer able to load CKEditor. I'm not sure if this is an issue with Layout Builder, this module, or my SVGs :).

Steps to reproduce

Create a layout builder node that contains an animated SVG and WYSIWYG/CKEDITOR elements. When editing the WYSIWYG content, you should experience javscript errors. Removing the SVG or enabling sanitize mode fixes the errors.

Proposed resolution

Auto-sanitize the field output when loaded in layout builder.

πŸ› Bug report
Status

Postponed: needs info

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States andyg5000 North Carolina, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡¨Ecuador jwilson3

    The approach in patch on #2 to single out layout builder doesn't feel like a very flexible approach.

    I presume you're using a <script> tag inside your SVG which is interfering with AJAX render in Layout Builder.

    For a proper fix or to even troubleshoot or investigate this, please provide an actual animated SVG file that triggers errors on the layout builder UI.

    Also, it is not clear that this issue is a CKEditor integration issue or a Layout Builder issue. Can you confirm the same errors do not also happen on other admin UI's outside of LB? Eg a simple Node Body field CKEDitor?

Production build 0.71.5 2024