CodeMirror Editor
OCodeInsert uses WordPress's built-in CodeMirror editor (wp-codemirror) -- no external dependencies.
Features:
- Syntax highlighting for HTML, JavaScript, and CSS
- Line numbers
- Bracket and tag matching
- Auto-indent
- Mode switches automatically when you change the Type dropdown
Mode mapping:
| Type | CodeMirror Mode |
|---|---|
| HTML | text/html (HTML mixed -- supports embedded JS and CSS) |
| JavaScript | text/javascript |
| CSS | text/css |
The editor is only loaded on the Snippets page, not the Settings page, to keep asset loading minimal.
