Just now I was thinking to myself, "Why is it that inline HTML must be stuck between the <html>
tags in Twine, anyway? Would it be possible to make HTML usable intersperced with Twine syntax?" So I decided to give it a try. The resulting Javascript code is as follows:
(function () { var bs = String.fromCharCode(92); Wikifier.formatters.unshift({ name: "htmltag", match: "<"+bs+"w+(?:(?:"+bs+"s+"+bs+"w+(?:"+bs+"s*="+bs+"s*(?:"+'"'+".*?"+'"'+"|'.*?'|[^'"+'"'+">"+bs+"s]+))?)+"+bs+"s*|"+bs+"s*)"+bs+"/?>", tagname: "<("+bs+"w+)", void: ["br", "hr", "area", "img", "input", "embed", "param", "source", "track"], handler: function (a) { var re, tn, e; re = new RegExp(this.tagname).exec(a.matchText); tn = re && re[1]; if(tn) { e = document.createElement(); e.innerHTML = a.matchText; e = e.firstChild; if(this.void.indexOf(tn.toLowerCase()) == -1) { a.subWikify(e, "<" + bs + "/" + bs + "s*" + tn + bs + "s*>"); } a.output.appendChild(e); } } }); }());
Feel free to report any bugs to @webbedspace.