diff --git a/js/WikiTextParser.js b/js/WikiTextParser.js index ed1401c9d..01542ec0e 100644 --- a/js/WikiTextParser.js +++ b/js/WikiTextParser.js @@ -47,6 +47,8 @@ var WikiTextParser = function(text) { WikiTextParser.prototype.render = function(type,store,title) { if(type === "text/html") { return this.renderAsHtml(store,title); + } else if (type === "text/plain") { + return this.renderAsText(store,title); } else { return null; } @@ -89,6 +91,22 @@ WikiTextParser.prototype.renderAsHtml = function(store,title) { return output.join(""); }; +WikiTextParser.prototype.renderAsText = function(store,title) { + var output = []; + var renderSubTree = function(tree) { + for(var t=0; t