forked from 0x2620/oxjs
support highlighting in icon list text
This commit is contained in:
parent
4dba56ba87
commit
1ae47b761b
4 changed files with 41 additions and 37 deletions
|
|
@ -75,13 +75,13 @@ Ox.highlightHTML <f> Highlight matches in an HTML string
|
|||
> Ox.highlightHTML('AT&T', 'amp', 'h')
|
||||
'AT&T'
|
||||
@*/
|
||||
Ox.highlightHTML = function(html, str, classname) {
|
||||
Ox.highlightHTML = function(html, str, classname, tags) {
|
||||
var count = 0,
|
||||
isEntity = false,
|
||||
isTag = false,
|
||||
position,
|
||||
positions = [],
|
||||
tags = ['a', 'b', 'code', 'i', 's', 'sub', 'sup', 'u'];
|
||||
positions = [];
|
||||
tags = Ox.merge(tags || [], ['a', 'b', 'code', 'i', 's', 'sub', 'sup', 'u']);
|
||||
str = Ox.encodeHTML(str).toLowerCase();
|
||||
Ox.forEach(html.toLowerCase(), function(chr, i) {
|
||||
// check for entity or tag start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue