Fixed issues with special formats not closing properly in <KoenigBasicHtmlInput>

no issue

- added missing special markup definitions for formats that are allowed via markdown text expansions
This commit is contained in:
Kevin Ansfield 2021-11-18 12:24:56 +00:00
parent 72ce1648a2
commit c4643314f3

View File

@ -14,9 +14,21 @@ import {getLinkMarkupFromRange} from '../utils/markup-utils';
import {registerBasicInputTextExpansions} from '../options/text-expansions';
import {run} from '@ember/runloop';
// TODO: extract core to share functionality between this and `{{koenig-editor}}`
const UNDO_DEPTH = 50;
// TODO: extract core to share functionality between this and `{{koenig-editor}}`
// markups that should not be continued when typing and reverted to their
// text expansion style when backspacing over final char of markup
const SPECIAL_MARKUPS = {
S: '~~',
CODE: {
char: '`',
replace: false
},
SUP: '^',
SUB: '~'
};
export default Component.extend({
// public attrs
@ -74,7 +86,7 @@ export default Component.extend({
init() {
this._super(...arguments);
this.SPECIAL_MARKUPS = [];
this.SPECIAL_MARKUPS = SPECIAL_MARKUPS;
this._lastSetHtml = this.html;
},