Fixed InputRule deletes the next unrelated char.

This commit is contained in:
Alecyrus 2019-10-23 17:17:28 +08:00 committed by GitHub
parent 4d140322e1
commit c70306eaed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ export default function (regexp, markType, getAttrs) {
if (match[m]) { if (match[m]) {
const matchStart = start + match[0].indexOf(match[m - 1]) const matchStart = start + match[0].indexOf(match[m - 1])
const matchEnd = matchStart + match[m - 1].length const matchEnd = matchStart + match[m - 1].length - 1
const textStart = matchStart + match[m - 1].lastIndexOf(match[m]) const textStart = matchStart + match[m - 1].lastIndexOf(match[m])
const textEnd = textStart + match[m].length const textEnd = textStart + match[m].length