mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 04:50:09 +08:00
Update auto pair quote logic (#2960)
* Update autoPairQuote logic * Fix spelling * Update Regex thing I thought matching anything except for space might be a better choice than selectively match some characters
This commit is contained in:
parent
220c6b9969
commit
358fa83d6d
@ -15,7 +15,7 @@ We are really excited that you are interested in contributing to MarkText :tada:
|
|||||||
## Philosophy
|
## Philosophy
|
||||||
|
|
||||||
🔑 Our philosophy is to keep things clean, simple and minimal.
|
🔑 Our philosophy is to keep things clean, simple and minimal.
|
||||||
MarkText is constantly changing and we want these improvements to align with our philosphy. For example, look at the side bar and tabs; these two panels provide awesome functionality *and* aren't distracting to the user. We'll continue adding more features (like plugins) that can be activated via 'settings' to improve MarkText. This will allow everyone to customize MarkText for their needs and provide a minimal default interface.
|
MarkText is constantly changing and we want these improvements to align with our philosophy. For example, look at the side bar and tabs; these two panels provide awesome functionality *and* aren't distracting to the user. We'll continue adding more features (like plugins) that can be activated via 'settings' to improve MarkText. This will allow everyone to customize MarkText for their needs and provide a minimal default interface.
|
||||||
|
|
||||||
## Issue Reporting Guidelines
|
## Issue Reporting Guidelines
|
||||||
|
|
||||||
|
@ -225,9 +225,9 @@ const inputCtrl = ContentState => {
|
|||||||
// Issue 2566: Do not complete markdown syntax if the previous character is
|
// Issue 2566: Do not complete markdown syntax if the previous character is
|
||||||
// alphanumeric.
|
// alphanumeric.
|
||||||
!/\\/.test(preInputChar) &&
|
!/\\/.test(preInputChar) &&
|
||||||
((autoPairQuote && /[']{1}/.test(inputChar) && !(/[a-zA-Z\d]{1}/.test(preInputChar))) ||
|
((autoPairQuote && /[']{1}/.test(inputChar) && !(/[\S]{1}/.test(postInputChar)) && !(/[a-zA-Z\d]{1}/.test(preInputChar))) ||
|
||||||
(autoPairQuote && /["]{1}/.test(inputChar)) ||
|
(autoPairQuote && /["]{1}/.test(inputChar) && !(/[\S]{1}/.test(postInputChar))) ||
|
||||||
(autoPairBracket && /[\{\[\(]{1}/.test(inputChar)) ||
|
(autoPairBracket && /[\{\[\(]{1}/.test(inputChar) && !(/[\S]{1}/.test(postInputChar))) ||
|
||||||
(block.functionType !== 'codeContent' && !isInInlineMath && !isInInlineCode && autoPairMarkdownSyntax && !/[a-z0-9]{1}/i.test(preInputChar) && /[*$`~_]{1}/.test(inputChar)))
|
(block.functionType !== 'codeContent' && !isInInlineMath && !isInInlineCode && autoPairMarkdownSyntax && !/[a-z0-9]{1}/i.test(preInputChar) && /[*$`~_]{1}/.test(inputChar)))
|
||||||
) {
|
) {
|
||||||
needRender = true
|
needRender = true
|
||||||
|
Loading…
Reference in New Issue
Block a user