Content deleted Content added
test |
lessee if this works |
||
Line 12:
if ( textbox )
{
var contents = textbox.val(
// Escape ref tags.
var escaped = [];
var i = 0;
contents = contents.replace(
/<ref[^>]+>[^<]+<\/ref>/g,
function(tag) {
escaped[i] = tag;
var replacement = "%%" + i + "%%";
i += 1;
return replacement;
}
);
contents = contents.replace(
/%%(\d+)%%/g,
function(wholematch, number) {
number = Number(number);
return escaped[number];
}
);
textbox.val(contents);
}
}
|