Uploaded image for project: 'Prism.js Macro'
  1. Prism.js Macro
  2. XPRISMJS-14

Code is not highlighted in the standalone WYSIWYG editor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.2
    • None
    • Unknown

    Description

      Page content used below:

      {{prism language="java"}}
      int x = 1;
      {{/prism}}
      

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

      1. Create a page with the content above 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: