mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:41:53 +08:00
* Improvement: #414 Add functional bracket auto-completion * bugFix: #414 wrong action with delete auto-complation function * bugfix: Fixed bullet order list chinese input error
This commit is contained in:
parent
41736a88e5
commit
486eb933b0
@ -407,6 +407,19 @@ const updateCtrl = ContentState => {
|
||||
const inputChar = text.charAt(+offset - 1)
|
||||
const preInputChar = text.charAt(+offset - 2)
|
||||
const postInputChar = text.charAt(+offset)
|
||||
/* eslint-disable no-useless-escape */
|
||||
if (
|
||||
(event.inputType.indexOf('delete') === -1) &&
|
||||
(inputChar === postInputChar) &&
|
||||
(
|
||||
(autoPairQuote && /[']{1}/.test(inputChar)) ||
|
||||
(autoPairQuote && /["]{1}/.test(inputChar)) ||
|
||||
(autoPairBracket && /[\}\]\)]{1}/.test(inputChar)) ||
|
||||
(autoPairMarkdownSyntax && /[*_]{1}/.test(inputChar))
|
||||
)
|
||||
) {
|
||||
text = text.substring(0, offset) + text.substring(offset + 1)
|
||||
} else {
|
||||
/* eslint-disable no-useless-escape */
|
||||
// Not Unicode aware, since things like \p{Alphabetic} or \p{L} are not supported yet
|
||||
if (
|
||||
@ -424,6 +437,7 @@ const updateCtrl = ContentState => {
|
||||
text = text.substring(0, offset) + text.substring(offset + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
block.text = text
|
||||
if (beginRules['reference_definition'].test(text)) {
|
||||
needRenderAll = true
|
||||
|
Loading…
Reference in New Issue
Block a user