0
Fork 0
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:
Kevin Ansfield 2018-01-11 09:20:05 +00:00
parent 7970640667
commit 832fd8bba3

View file

@ -503,6 +503,9 @@ export default Component.extend(ShortcutsMixin, {
// default to spellchecker being off
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
// editor container so that they can be aligned in fixed positions
let container = this.$().closest('.gh-editor').find('.gh-editor-footer');