aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-06 06:07:32 +1000
committerredmatrix <git@macgirvin.com>2016-04-06 06:07:32 +1000
commitea3fb53e4b7b93dfb353448b8ed59f792ec5544f (patch)
tree3299929d9d337762fcc88655c668a5a668ea4e99
parenta7d5bf6854d207b4cb976a3f7773caf5a4c89801 (diff)
parent1eb6067c31f10c8da262fd8aef8d740b94d85137 (diff)
downloadvolse-hubzilla-ea3fb53e4b7b93dfb353448b8ed59f792ec5544f.tar.gz
volse-hubzilla-ea3fb53e4b7b93dfb353448b8ed59f792ec5544f.tar.bz2
volse-hubzilla-ea3fb53e4b7b93dfb353448b8ed59f792ec5544f.zip
Merge pull request #339 from anaqreon/autocomplete
Improve (un)ordered list autocompletion for list construction
-rw-r--r--view/js/autocomplete.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index b4879d464..3e7e08b35 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -202,7 +202,7 @@ function submit_form(e) {
$.fn.bbco_autocomplete = function(type) {
if(type=='bbcode') {
- var open_close_elements = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer'];
+ var open_close_elements = ['b', 'i', 'u', 's', 'quote', 'code', 'spoiler', 'map', 'nobb', 'li', 'list', 'ul', 'ol', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'zrl', 'zmg', 'rpost', 'qr', 'observer'];
var open_elements = ['observer.baseurl', 'observer.address', 'observer.photo', 'observer.name', 'observer.webname', 'observer.url', '*', 'hr', ];
var elements = open_close_elements.concat(open_elements);
@@ -225,7 +225,11 @@ 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 + '\]'];
+ }
}
else {
return '\[' + element + '\] ';