Bug 40293 - Additional content codemirror mode initializes as xml
Summary: Additional content codemirror mode initializes as xml
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 38706
  Show dependency treegraph
 
Reported: 2025-07-02 15:13 UTC by Lisette Scheer
Modified: 2025-07-02 15:14 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lisette Scheer 2025-07-02 15:13:39 UTC
In additional contents with the wysiwyg preference set to text, the codemirror initalizes with mode xml. It lints properly but 

To recreate on main:
1. Set wysiwyg preference to text
2. Go To tools->news
3. Edit or create a news item
4. In your browser console, copy and paste the following in:


document.querySelectorAll('.CodeMirror').forEach((cm, i) => {
    console.log(`Editor ${i}:`, cm.CodeMirror.getMode().name);
});

It will return 
Editor 0: xml

It lints html properly, but the mode is wrong.

If you go to system preferences and find intranetuserjs and expand the box, then run the same command in your console, you'll get 

Editor 0: javascript