Commit b3f2374b authored by Mario's avatar Mario
Browse files

work around some weird regex interference

parent 793881b9
......@@ -162,20 +162,20 @@ function string2bb(element) {
if (typeof extra_channels === 'undefined') extra_channels = false;
// Autocomplete contacts
channels = {
match: /(^(?=[^\!]{2})|\s)(@)([^ \n]{3,})$/,
contacts = {
match: /(^|\s)(@\!)([^ \n]{3,})$/,
index: 3,
cache: true,
search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); },
search: function(term, callback) { contact_search(term, callback, backend_url, 'm', extra_channels, spinelement=false); },
replace: editor_replace,
template: contact_format
};
contacts = {
match: /(^|\s)(@\!)([^ \n]{3,})$/,
channels = {
match: /(^(?=[^\!]{2})|\s)(@)([^ \n]{3,})$/,
index: 3,
cache: true,
search: function(term, callback) { contact_search(term, callback, backend_url, 'm', extra_channels, spinelement=false); },
search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); },
replace: editor_replace,
template: contact_format
};
......@@ -211,7 +211,8 @@ function string2bb(element) {
maxCount: 100
}
});
textcomplete.register([channels,contacts,smilies,tags]);
// it seems important that contacts are before channels here. Otherwise we run into regex issues.
textcomplete.register([contacts,channels,smilies,tags]);
});
};
})( jQuery );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment