From 9b5856fff0e089ef97a2b2f60c1b3a94b01852f3 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 18 Sep 2016 17:05:29 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20text=20complete=20extra=20tags=20for=20bl?= =?UTF-8?q?ockquote=20and=20referral=20shouldn't=20match=20after=20the=20t?= =?UTF-8?q?arget=20search=20and=20referral=20regex=20now=20need=20two=20sp?= =?UTF-8?q?aces=20when=20after=20some=20text=E2=80=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 41618ccf..0a4395ee 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -3759,7 +3759,7 @@ $(editor.getInputField()) } }, { //extra tags for blockquote - match: /(?:^|\n|\s)(\>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|\:|))(\w*)$/, + match: /(?:^|\n|\s)(\>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|\:|)\s*\w*)$/, search: function (term, callback) { var line = editor.getLine(editor.getCursor().line); quote = line.match(this.match)[1].trim(); @@ -3805,7 +3805,7 @@ $(editor.getInputField()) } }, { //referral - match: /(^|\n|\s)(\!(\[\]|)(\[\]|\(\)|))(\w*)$/, + match: /(^\s*|\n|\s{2})((\[\]|\[\]\[\]|\[\]\(\)|\!|\!\[\]|\!\[\]\[\]|\!\[\]\(\))\s*\w*)$/, search: function (term, callback) { callback($.map(supportReferrals, function (referral) { return referral.search.indexOf(term) === 0 ? referral.text : null;