summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2017-03-23 20:49:31 +0800
committerWu Cheng-Han2017-03-23 20:49:31 +0800
commit3156c3859825259232a59b0d7c4100540b659be0 (patch)
treed2b6721dacfbee3299aef48f86d2391860a9caa4
parent890f7089bf2efaafdb51c976f14db6102dab2b3c (diff)
Fix text complete of extra tags for list not triggered properly
-rw-r--r--public/js/index.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 520850f0..bb942122 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -3313,17 +3313,13 @@ $(editor.getInputField())
return !isInCode
}
},
- { // extra tags for blockquote
- match: /(?:^|\n|\s)(>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|:|)\s*\w*)$/,
+ { // extra tags for list
+ match: /(^[>\s]*[-+*]\s(?:\[[x ]\]|.*))(\[\])(\w*)$/,
search: function (term, callback) {
- var line = editor.getLine(editor.getCursor().line)
- var quote = line.match(this.match)[1].trim()
var list = []
- if (quote.indexOf('>') === 0) {
- $.map(supportExtraTags, function (extratag) {
- if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
- })
- }
+ $.map(supportExtraTags, function (extratag) {
+ if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
+ })
$.map(supportReferrals, function (referral) {
if (referral.search.indexOf(term) === 0) { list.push(referral.text) }
})
@@ -3336,13 +3332,17 @@ $(editor.getInputField())
return !isInCode
}
},
- { // extra tags for list
- match: /(^[>\s]*[-+*]\s(?:\[[x ]\]|.*))(\[\])(\w*)$/,
+ { // extra tags for blockquote
+ match: /(?:^|\n|\s)(>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|:|)\s*\w*)$/,
search: function (term, callback) {
+ var line = editor.getLine(editor.getCursor().line)
+ var quote = line.match(this.match)[1].trim()
var list = []
- $.map(supportExtraTags, function (extratag) {
- if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
- })
+ if (quote.indexOf('>') === 0) {
+ $.map(supportExtraTags, function (extratag) {
+ if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
+ })
+ }
$.map(supportReferrals, function (referral) {
if (referral.search.indexOf(term) === 0) { list.push(referral.text) }
})