aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/autocomplete.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-04-06 22:18:59 +0200
committerMario Vavti <mario@mariovavti.com>2016-04-06 22:18:59 +0200
commit97ccbf1bfb95be412393bed207a26fd8d0cbf512 (patch)
tree6682ae0e439c46b5102d26a10a74f1796457f279 /view/js/autocomplete.js
parenta20ef706fd6e7011a0dc95df71222b9a5871e3b3 (diff)
downloadvolse-hubzilla-97ccbf1bfb95be412393bed207a26fd8d0cbf512.tar.gz
volse-hubzilla-97ccbf1bfb95be412393bed207a26fd8d0cbf512.tar.bz2
volse-hubzilla-97ccbf1bfb95be412393bed207a26fd8d0cbf512.zip
adjust the regex to also work with asteriks and use the simpler syntax for lists
Diffstat (limited to 'view/js/autocomplete.js')
-rw-r--r--view/js/autocomplete.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 3e7e08b35..5f67476df 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -216,7 +216,7 @@ function submit_form(e) {
}
bbco = {
- match: /\[(\w*)$/,
+ match: /\[(\w*\**)$/,
search: function (term, callback) {
callback($.map(elements, function (element) {
return element.indexOf(term) === 0 ? element : null;
@@ -225,11 +225,12 @@ function submit_form(e) {
index: 1,
replace: function (element) {
if(open_elements.indexOf(element) < 0) {
- if(element === 'ol' || element === 'ul') {
- return ['\[' + element + '\]' + '\n\[li\]', '\[/li\]\n' + '\[/' + element + '\]'];
- } else {
- return ['\[' + element + '\]', '\[/' + element + '\]'];
- }
+ if(element === 'list' || element === 'ol' || element === 'ul') {
+ return ['\[' + element + '\]' + '\n\[*\] ', '\n\[/' + element + '\]'];
+ }
+ else {
+ return ['\[' + element + '\]', '\[/' + element + '\]'];
+ }
}
else {
return '\[' + element + '\] ';