Fix automath tests

This commit is contained in:
Sauli Anto
2019-10-11 18:10:41 +03:00
parent b456ed6965
commit 786fc0f3ce
4 changed files with 22 additions and 16 deletions

View File

@@ -5,7 +5,7 @@ import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange';
import LivePosition from '@ckeditor/ckeditor5-engine/src/model/liveposition';
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
import { defaultConfig, extractDelimiters, hasDelimiters } from './utils';
import { defaultConfig, extractDelimiters, hasDelimiters, delimitersCounts } from './utils';
export default class AutoMath extends Plugin {
static get requires() {
@@ -76,7 +76,7 @@ export default class AutoMath extends Plugin {
text = text.trim();
// Skip if don't have delimiters
if ( !hasDelimiters( text ) ) {
if ( !hasDelimiters( text ) || delimitersCounts( text ) !== 2 ) {
return;
}