Bug 40293

Summary: Additional content codemirror mode initializes as xml
Product: Koha Reporter: Lisette Scheer <lisette>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 38706    

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