mirror of
https://github.com/marktext/marktext.git
synced 2025-05-04 08:29:18 +08:00
bugfix: #351 only auto pair double quote
This commit is contained in:
parent
b9866cb662
commit
32f954faec
@ -397,8 +397,7 @@ const updateCtrl = ContentState => {
|
|||||||
'(': ')',
|
'(': ')',
|
||||||
'*': '*',
|
'*': '*',
|
||||||
'_': '_',
|
'_': '_',
|
||||||
'"': '"',
|
'"': '"'
|
||||||
"'": "'"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start.key === end.key && start.offset === end.offset && event.type === 'input') {
|
if (start.key === end.key && start.offset === end.offset && event.type === 'input') {
|
||||||
@ -409,7 +408,7 @@ const updateCtrl = ContentState => {
|
|||||||
const postInputChar = text.charAt(+offset)
|
const postInputChar = text.charAt(+offset)
|
||||||
/* eslint-disable no-useless-escape */
|
/* eslint-disable no-useless-escape */
|
||||||
if (
|
if (
|
||||||
(autoPairQuote && /["']{1}/.test(inputChar)) ||
|
(autoPairQuote && /["]{1}/.test(inputChar)) ||
|
||||||
(autoPairBracket && /[\{\[\(]{1}/.test(inputChar)) ||
|
(autoPairBracket && /[\{\[\(]{1}/.test(inputChar)) ||
|
||||||
(autoPairMarkdownSyntax && /[*_]{1}/.test(inputChar))
|
(autoPairMarkdownSyntax && /[*_]{1}/.test(inputChar))
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user