1
0
Fork 0
forked from 0x2620/oxjs

support highlighting in icon list text

This commit is contained in:
rlx 2012-02-01 11:57:21 +00:00
commit 1ae47b761b
4 changed files with 41 additions and 37 deletions

View file

@ -75,13 +75,13 @@ Ox.highlightHTML <f> Highlight matches in an HTML string
> Ox.highlightHTML('AT&amp;T', 'amp', 'h')
'AT&amp;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