From ab46f8177730384b4a314df145fc2d491f2ab49f Mon Sep 17 00:00:00 2001 From: teramako Date: Sun, 14 Dec 2008 16:01:45 +0000 Subject: fix bug git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26699 d0d07461-0603-4401-acd4-de1884942a52 --- pluginManager.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'pluginManager.js') diff --git a/pluginManager.js b/pluginManager.js index 4836cef..12e4e65 100644 --- a/pluginManager.js +++ b/pluginManager.js @@ -7,9 +7,10 @@ var PLUGIN_INFO = 0.2 2.0pre 2.0pre - 0) + if (value && value.toString().length > 0) plugin.push([tag, value]); } } @@ -183,6 +184,7 @@ function WikiParser(text){ this.mode = ''; this.lines = text.split(/\n\r|[\r\n]/); this.preCount = 0; + this.pendingMode = ''; this.xmlstack = new HTMLStack(); } WikiParser.prototype = { @@ -223,6 +225,7 @@ WikiParser.prototype = { return <>{line}; } else if (this.wikiReg.preStart.test(line)){ this.mode = 'pre'; + this.pendingMode = prevMode; return
;
         } else if (this.wikiReg.hn.test(line)){
             var hn = RegExp.$1.length - 1;
@@ -263,8 +266,7 @@ WikiParser.prototype = {
                     this.xmlstack.appendLastChild(indent.substr(prevIndent) + line + "\n");
                 } else {
                     this.xmlstack.reorg(-2);
-                    this.mode = this.xmlstack.lastLocalName;
-                    if (this.mode == 'pre') this.mode = '';
+                    this.mode = this.pendingMode;
                     indentList.pop();
                     if (indentList.length == 0) indentList = [0];
                 }
@@ -284,7 +286,7 @@ WikiParser.prototype = {
                     this.xmlstack.push(bufXML);
                     indentList.push(currentIndent);
                 } else {
-                    if (this.xmlstack.length > 0){
+                    if (prevMode && this.xmlstack.length > 0){
                         this.xmlstack.appendLastChild(bufXML);
                     } else {
                         this.xmlstack.append(bufXML);
@@ -425,4 +427,4 @@ var public = {
 };
 return public;
 })();
-// vim: sw=4 ts=4 fdm=marker:
+// vim: sw=4 ts=4 et fdm=marker:
-- 
cgit v1.2.3