This issue has been created
There is 1 update.
 
 
Prism.js Macro / cid:jira-generated-image-avatar-8d19adbf-f844-447e-b475-73383b42f052 XPRISMJS-14 Open

Code is not highlighted in the standalone WYSIWYG editor

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-b490d93c-107f-4355-804f-4023176976f4 Vincent Massol created this issue on 20/Oct/26 16:36
 
Summary: Code is not highlighted in the standalone WYSIWYG editor
Issue Type: cid:jira-generated-image-avatar-8d19adbf-f844-447e-b475-73383b42f052 Bug
Affects Versions: 1.2
Assignee: Unassigned
Created: 20/Oct/26 16:36
Priority: cid:jira-generated-image-static-major-e80b9c46-73c7-498e-be55-53d1484fda45 Major
Reporter: Vincent Massol
Description:

Steps to reproduce, on XWiki 18.8.0 with the Prism.js Macro installed:

  1. Create a page holding {{prism language="java"}}int x = 1;{{/prism}} and save it: the code is highlighted in view mode.
  2. Edit the page with the standalone WYSIWYG editor ("Edit > WYSIWYG", i.e. /bin/edit/...?editor=wysiwyg).

Result: the code is not highlighted inside the editor. The Prism.js CSS (prism-accessible.css, prism-line-numbers.css) is loaded in the editor's iframe, but Prism.js itself only runs in the top window, so the <code class="language-java"> elements of the iframe get no tokens.

Expected: the code is highlighted in the standalone WYSIWYG editor too, as it is when editing the page in place (in-place editing works fine).

Found while documenting the extension (tested with 1.3-SNAPSHOT). Related to XPRISMJS-7, which fixed the highlighting for in-place editing.

 
 

1 update

 
cid:jira-generated-image-avatar-b490d93c-107f-4355-804f-4023176976f4 Changes by Vincent Massol on 20/Oct/26 16:37
 
Description: Steps to reproduce, on XWiki 18.8.0 with the Prism.js Macro installed Page content used below :
{noformat}
# Create a page holding {{ \{\{ prism language="java" \ } \ }
int x = 1; \
{ \ {/prism \ } \ }
{noformat
} }

Steps to reproduce, on XWiki 18.8.0 with the Prism.js Macro installed:

# Create a page with the content above
and save it: the code is highlighted in view mode.
# Edit the page with the standalone WYSIWYG editor ("Edit > WYSIWYG", i.e. {{/bin/edit/...?editor=wysiwyg}}).

*Result*: the code is not highlighted inside the editor. The Prism.js CSS ({{prism-accessible.css}}, {{prism-line-numbers.css}}) is loaded in the editor's iframe, but Prism.js itself only runs in the top window, so the {{<code class="language-java">}} elements of the iframe get no tokens.

*Expected*: the code is highlighted in the standalone WYSIWYG editor too, as it is when editing the page in place (in-place editing works fine).

Found while documenting the extension (tested with 1.3-SNAPSHOT). Related to XPRISMJS-7, which fixed the highlighting for in-place editing.