WYSIWYG editor hangs ("too much recursion") on pages that embed a a page containing a draw.io diagram (Diagram macro)

Hi,

we have a problem with the WYSIWYG (CKEditor) editor on XWiki 18.6.0 (Debian package).

Setup:

  • A wiki macro (Velocity) is used on many pages. It includes several sub-pages via {{display reference="..." /}}.
  • One of the displayed sub-pages contains a network diagram created with the Diagram Application (draw.io integration) and shown with the Diagram macro.

Problem:

  • Opening such a page in the WYSIWYG editor takes extremely long. The browser console shows Uncaught InternalError: too much recursion in ckeditor.js (call stack: setData → frameLoadedHandler). Same behavior in Firefox and Edge.
  • The same page opens instantly in the Wiki (source) editor, and the normal view is fine.
  • If I remove the {{display}} of the sub-page that contains the draw.io diagram, the WYSIWYG editor loads immediately. The other displayed sub-pages (small, no diagram) are not a problem.
  • The server side is not slow: rendering each sub-page takes only a few milliseconds.
  • Replacing {{display}} with the rendered HTML in an {{html}} block does not help, because the draw.io diagram is then no longer shown correctly.

Questions:

  1. Is this a known issue with draw.io diagrams (Diagram macro) inside CKEditor?
  2. Is there a setting (e.g. the “cached” option of the Diagram macro or a CKEditor option) to avoid rendering the diagram inside the editor?
  3. Is there a better way to show a draw.io diagram from another page without slowing down the editor?

Versions: XWiki 18.6.0, Diagram Application 1.3.1.

Thanks!