Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
update: function(abbr) {
abbr = abbr.trim();
var tag, replaced;
var didUpdate = false;
for (var i = selCtx.length - 1, ctx; i >= 0; i--) {
ctx = selCtx[i];
tag = null;
if (abbr) {
try {
tag = updateTag.getUpdatedTag(abbr, {match: ctx.tag}, info.content, {
counter: ctx.counter
});
} catch (e) {
console.error(e);
}
}
if (!tag) {
continue;
}
replaced = [{
start: ctx.tag.open.range.start,
end: ctx.tag.open.range.end,
content: tag.source
}];