Skip to content

Commit bfc24f0

Browse files
authored
fix: regex
1 parent 54914bd commit bfc24f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/editor/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ class Editor extends React.Component<EditorProps, EditorState> {
191191
}
192192
}
193193

194+
isComposing() {
195+
return this.composing;
196+
}
197+
194198
private getPlugins() {
195199
let plugins: Plugin[] = [];
196200
if (this.props.plugins) {
@@ -387,7 +391,7 @@ class Editor extends React.Component<EditorProps, EditorState> {
387391
private handleEditorKeyDown(e: React.KeyboardEvent<HTMLTextAreaElement>) {
388392
const { keyCode, key, currentTarget } = e;
389393
if ((keyCode === 13 || key === 'Enter') && this.composing === false) {
390-
const text = e.currentTarget.value;
394+
const text = currentTarget.value;
391395
const curPos = currentTarget.selectionStart;
392396
const lineInfo = getLineAndCol(text, curPos);
393397

@@ -411,7 +415,7 @@ class Editor extends React.Component<EditorProps, EditorState> {
411415
// Enter key, check previous line
412416
const isSymbol = lineInfo.curLine.match(/^(\s*?)\* /);
413417
if (isSymbol) {
414-
if (/^(\s*?)\\* $/.test(lineInfo.curLine)) {
418+
if (/^(\s*?)\* $/.test(lineInfo.curLine)) {
415419
emptyCurrentLine();
416420
return;
417421
}

0 commit comments

Comments
 (0)