allow case independence of replacements as well as patterns
This commit is contained in:
parent
6d0e1b0e07
commit
f54aa4f21e
@ -18,7 +18,7 @@ class Hashtags extends \Zotlabs\Web\Controller {
|
|||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $rv) {
|
foreach($r as $rv) {
|
||||||
$result[] = [ 'text' => strtolower($rv['term']) ];
|
$result[] = [ 'text' => $rv['term'] ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ function string2bb(element) {
|
|||||||
tags = {
|
tags = {
|
||||||
match: /(^|\s)(\#)([^ \n]{2,})$/,
|
match: /(^|\s)(\#)([^ \n]{2,})$/,
|
||||||
index: 3,
|
index: 3,
|
||||||
search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
|
search: function(term, callback) { $.getJSON('/hashtags/' + '$f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null; })); }); },
|
||||||
replace: function(item) { return "$1$2" + item.text + ' '; },
|
replace: function(item) { return "$1$2" + item.text + ' '; },
|
||||||
context: function(text) { return text.toLowerCase(); },
|
context: function(text) { return text.toLowerCase(); },
|
||||||
template: tag_format
|
template: tag_format
|
||||||
|
Reference in New Issue
Block a user