summaryrefslogtreecommitdiff
path: root/public/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/index.js')
-rw-r--r--public/js/index.js32
1 files changed, 27 insertions, 5 deletions
diff --git a/public/js/index.js b/public/js/index.js
index c414b0b5..28503413 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -102,7 +102,7 @@ var supportExternals = [
search: 'gist'
}
];
-var supportBlockquoteTags = [
+var supportExtraTags = [
{
text: '[name tag]',
search: '[]',
@@ -2031,13 +2031,35 @@ $(editor.getInputField())
return !isInCode;
}
},
- { //blockquote personal info & general info
+ { //extra tags for blockquote
match: /(?:^|\n|\s)(\>.*)(\[\])(\w*)$/,
search: function (term, callback) {
var list = [];
- $.map(supportBlockquoteTags, function (blockquotetag) {
- if (blockquotetag.search.indexOf(term) === 0)
- list.push(blockquotetag.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);
+ })
+ callback(list);
+ checkCursorMenu();
+ },
+ replace: function (value) {
+ return '$1' + value;
+ },
+ context: function (text) {
+ return !isInCode;
+ }
+ },
+ { //extra tags for list
+ match: /(^[>\s]*[\-\+\*]\s(?:\[[x ]\]|.*))(\[\])(\w*)$/,
+ search: function (term, callback) {
+ var list = [];
+ $.map(supportExtraTags, function (extratag) {
+ if (extratag.search.indexOf(term) === 0)
+ list.push(extratag.command());
});
$.map(supportReferrals, function (referral) {
if (referral.search.indexOf(term) === 0)