diff --git a/grammars/mediawiki.js b/grammars/mediawiki.js
index 2a97d36..fe374e1 100644
--- a/grammars/mediawiki.js
+++ b/grammars/mediawiki.js
@@ -294,3 +294,8 @@ var mediawiki = {
rr.ZeroOrMore(rr.Ref('paragraph')),
rr.EndOfText()))
};
+
+
+var mediawiki_filters = {
+ 'bi': rr.SplitTagAndNest('b', 'i')
+};
diff --git a/recentrunes.js b/recentrunes.js
index 8885d00..0647545 100644
--- a/recentrunes.js
+++ b/recentrunes.js
@@ -716,10 +716,51 @@ rr.SingleLineText = function() {
+/* ============ Filters ============ */
+
+
+rr.SplitTagAndNest = function() {
+ var hierarchy = Array.prototype.slice.call(arguments);
+ return function(node) {
+ var outerNode, innerNode;
+ for (var i = 0; i < hierarchy.length; i++) {
+ var newNode = document.createElement(hierarchy[i]);
+ if (i == 0) {
+ outerNode = innerNode = newNode;
+ } else {
+ innerNode.appendChild(newNode);
+ innerNode = newNode;
+ }
+ }
+ for (var i = 0; i < node.childNodes.length; i++) {
+ innerNode.appendChild(node.childNodes[i]);
+ }
+ node.parentNode.replaceChild(outerNode, node);
+ }
+};
+
+
+
/* ============ Scaffolding ============ */
+/**
+ * @param {Node} node
+ * @param {Object. This is a paragraph with many text styles. This is italic and ',
- 'this \nis bold; this is strikethrough, as is this. Source ',
- '\ncode looks like this. Fixed width text looks like \n',
- 'this. This sentence is inline pre-formatted, which stops \n',
- "'''''this from being bold and italic.'''''
We can also \nstop ",
+ 'this \nis bold; this is both. This is underline',
+ ' as is \nthis. This is underlined, bold and italic',
+ '. \nThis is strikethrough, as is this. ',
+ 'Source \ncode looks like this. Fixed width text looks like ',
+ '\nthis. This sentence is inline pre-formatted, which stops',
+ " \n'''''this from being bold and italic.'''''
We can also \nstop ",
'<u>this from being underlined</u>, or just try \n',
'<pre>interrupting cow style.</pre>This is a ',
'blockquote