From 32f954faec6f11cd3da9fcce2b2e58a9c9af5118 Mon Sep 17 00:00:00 2001 From: Jocs Date: Mon, 18 Jun 2018 22:47:58 +0800 Subject: [PATCH] bugfix: #351 only auto pair double quote --- src/editor/contentState/updateCtrl.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/editor/contentState/updateCtrl.js b/src/editor/contentState/updateCtrl.js index 94f4ae92..7ba17d05 100644 --- a/src/editor/contentState/updateCtrl.js +++ b/src/editor/contentState/updateCtrl.js @@ -397,8 +397,7 @@ const updateCtrl = ContentState => { '(': ')', '*': '*', '_': '_', - '"': '"', - "'": "'" + '"': '"' } if (start.key === end.key && start.offset === end.offset && event.type === 'input') { @@ -409,7 +408,7 @@ const updateCtrl = ContentState => { const postInputChar = text.charAt(+offset) /* eslint-disable no-useless-escape */ if ( - (autoPairQuote && /["']{1}/.test(inputChar)) || + (autoPairQuote && /["]{1}/.test(inputChar)) || (autoPairBracket && /[\{\[\(]{1}/.test(inputChar)) || (autoPairMarkdownSyntax && /[*_]{1}/.test(inputChar)) ) {