version.extensions['timedreplaceMacro'] = { major: 1, minor: 1, revision: 0 }; macros['timedreplace'] = { handler: function (g, e, f, b) { function tagcontents(starttag, endtag, k) { var a = b.source.slice(k); var l = 0; var c = ""; for (var i = 0; i < a.length; i++) { var w = endtag.length; if (a.substr(i, w) == endtag) { if (l == 0) { b.nextMatch = k + i + w; return c; } else { l--; c += a.charAt(i); } } else { if (a.substr(i, starttag.length) == starttag) { l++; } c += a.charAt(i); } } return ""; } var tr = "<>', b.matchStart) + 2; var c = tagcontents(tr, rw, k); var d = tagcontents((c ? rw : tr), "<>", c ? b.nextMatch : k); var h = null; if (c) { h = insertElement(g, "span", null, "timedreplacement timedreplacement1"); new Wikifier(h, c); } if (d) { var m = insertElement(g, "span", null, "timedreplacement timedreplacement2", d); m.style.display = "none"; setTimeout(function () { if (m) { if (h && h.parentNode) { h.classList.add("replacement-out"); setTimeout(function () { h.parentNode.removeChild(h); }, 1000); } var t = m.firstChild ? m.firstChild.nodeValue : ""; removeChildren(m); new Wikifier(m, t); m.style.display = "inline"; m.classList.add("replacement-in"); setTimeout(function () { m.classList.remove("replacement-in"); }, 1); } }, (parseInt(f[0]) || 0) * 500); } else { throwError(g, "can't find matching endtimedreplace"); return; } } } macros['endtimedreplace'] = { handler: function () {} } macros['replacewith'] = { handler: function () {} }