Skip to content

Commit 3156c38

Browse files
committed
Fix text complete of extra tags for list not triggered properly
1 parent 890f708 commit 3156c38

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

public/js/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,17 +3313,13 @@ $(editor.getInputField())
33133313
return !isInCode
33143314
}
33153315
},
3316-
{ // extra tags for blockquote
3317-
match: /(?:^|\n|\s)(>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|:|)\s*\w*)$/,
3316+
{ // extra tags for list
3317+
match: /(^[>\s]*[-+*]\s(?:\[[x ]\]|.*))(\[\])(\w*)$/,
33183318
search: function (term, callback) {
3319-
var line = editor.getLine(editor.getCursor().line)
3320-
var quote = line.match(this.match)[1].trim()
33213319
var list = []
3322-
if (quote.indexOf('>') === 0) {
3323-
$.map(supportExtraTags, function (extratag) {
3324-
if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
3325-
})
3326-
}
3320+
$.map(supportExtraTags, function (extratag) {
3321+
if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
3322+
})
33273323
$.map(supportReferrals, function (referral) {
33283324
if (referral.search.indexOf(term) === 0) { list.push(referral.text) }
33293325
})
@@ -3336,13 +3332,17 @@ $(editor.getInputField())
33363332
return !isInCode
33373333
}
33383334
},
3339-
{ // extra tags for list
3340-
match: /(^[>\s]*[-+*]\s(?:\[[x ]\]|.*))(\[\])(\w*)$/,
3335+
{ // extra tags for blockquote
3336+
match: /(?:^|\n|\s)(>.*|\s|)((\^|)\[(\^|)\](\[\]|\(\)|:|)\s*\w*)$/,
33413337
search: function (term, callback) {
3338+
var line = editor.getLine(editor.getCursor().line)
3339+
var quote = line.match(this.match)[1].trim()
33423340
var list = []
3343-
$.map(supportExtraTags, function (extratag) {
3344-
if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
3345-
})
3341+
if (quote.indexOf('>') === 0) {
3342+
$.map(supportExtraTags, function (extratag) {
3343+
if (extratag.search.indexOf(term) === 0) { list.push(extratag.command()) }
3344+
})
3345+
}
33463346
$.map(supportReferrals, function (referral) {
33473347
if (referral.search.indexOf(term) === 0) { list.push(referral.text) }
33483348
})

0 commit comments

Comments
 (0)