mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🎨 Highlight non-breaking spaces as special chars in the editor
closes https://github.com/TryGhost/Ghost/issues/9384 - add non-breaking space char to CodeMirror's default "specialChars" regex so that they are visible in the editor
This commit is contained in:
parent
7970640667
commit
832fd8bba3
1 changed files with 3 additions and 0 deletions
|
@ -503,6 +503,9 @@ export default Component.extend(ShortcutsMixin, {
|
||||||
// default to spellchecker being off
|
// default to spellchecker being off
|
||||||
this._editor.codemirror.setOption('mode', 'gfm');
|
this._editor.codemirror.setOption('mode', 'gfm');
|
||||||
|
|
||||||
|
// add non-breaking space as a special char
|
||||||
|
this._editor.codemirror.setOption('specialChars', /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\xa0]/g);
|
||||||
|
|
||||||
// HACK: move the toolbar & status bar elements outside of the
|
// HACK: move the toolbar & status bar elements outside of the
|
||||||
// editor container so that they can be aligned in fixed positions
|
// editor container so that they can be aligned in fixed positions
|
||||||
let container = this.$().closest('.gh-editor').find('.gh-editor-footer');
|
let container = this.$().closest('.gh-editor').find('.gh-editor-footer');
|
||||||
|
|
Loading…
Add table
Reference in a new issue