fixed bug with some attributes
authoraxelcl <axelcl>
Sun, 13 Feb 2005 19:09:48 +0000 (19:09 +0000)
committeraxelcl <axelcl>
Sun, 13 Feb 2005 19:09:48 +0000 (19:09 +0000)
archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar
archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FontFilterTest.java [new file with mode: 0644]
archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/WrongTagFilterTest.java [new file with mode: 0644]
archive/org.plog4u.wiki/src/org/plog4u/wiki/filter/WikipediaParser.java

index 590d991..998ae20 100644 (file)
Binary files a/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar and b/archive/net.sourceforge.phpeclipse.wiki/lib/plog4u.jar differ
diff --git a/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FontFilterTest.java b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/FontFilterTest.java
new file mode 100644 (file)
index 0000000..ce69e1c
--- /dev/null
@@ -0,0 +1,37 @@
+package org.plog4u.wiki.test.filter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.plog4u.wiki.filter.WikipediaFilter;
+
+public class FontFilterTest extends FilterTestSupport {
+  public FontFilterTest(String name) {
+    super(name);
+  }
+
+  protected void setUp() throws Exception {
+    filter = new WikipediaFilter();
+    super.setUp();
+  }
+
+  public static Test suite() {
+    return new TestSuite(FontFilterTest.class);
+  }
+
+  public void testFont1() {
+    assertEquals("<font color=\"red\">Text</font>", filter.filter("<font color=\"red\">Text</font>", context));
+  }
+
+  public void testFont2() {
+    assertEquals("<font color=\"red\">Text</font>", filter.filter("<font color=\"red>Text</font>", context));
+  }
+
+  public void testFont3() {
+    assertEquals("<font color=\"red\">Text</font>", filter.filter("<font color=red>Text</font>", context));
+  }
+
+  public void testFont4() {
+    assertEquals("<font color=\"red\">Text</font>", filter.filter("<font color=red\">Text</font>", context));
+  }
+}
\ No newline at end of file
diff --git a/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/WrongTagFilterTest.java b/archive/org.plog4u.wiki.test/src/org/plog4u/wiki/test/filter/WrongTagFilterTest.java
new file mode 100644 (file)
index 0000000..d4bff50
--- /dev/null
@@ -0,0 +1,26 @@
+package org.plog4u.wiki.test.filter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.plog4u.wiki.filter.WikipediaFilter;
+
+public class WrongTagFilterTest extends FilterTestSupport {
+  public WrongTagFilterTest(String name) {
+    super(name);
+  }
+
+  protected void setUp() throws Exception {
+    filter = new WikipediaFilter();
+    super.setUp();
+  }
+
+  public static Test suite() {
+    return new TestSuite(WrongTagFilterTest.class);
+  }
+
+  public void testWrongTag1() {
+    assertEquals("&lt;blubber&gt;...", filter.filter("<blubber>...", context));
+  }
+
+}
\ No newline at end of file
index 2e04285..f0a4790 100644 (file)
@@ -443,7 +443,7 @@ public class WikipediaParser {
             fResultBuffer.append("<");
             fResultBuffer.append(token.getTagName());
             fTokenStack.push(token);
-            fCurrentPosition = token.scan(fResultBuffer, fSource, fCurrentPosition - 1);
+            fCurrentPosition = token.scan(fResultBuffer, fSource, fCurrentPosition);
             fResultBuffer.append(">");
             return WikipediaFilter.TokenIgnore;
           }
@@ -912,16 +912,17 @@ public class WikipediaParser {
             // table
             // syntax
             continue;
-          } else {
-            if (readUntilChar('}')) {
-              String macroStartTag;
-
-              macroStartTag = new String(fSource, startMacroPosition, fCurrentPosition - startMacroPosition - 1);
-              if (macroStartTag != null) {
-                createMacro(startMacroPosition, macroStartTag);
-                continue;
-              }
-            }
+//          } else {
+// SnipSnap / Radeox Macro Syntax
+//            if (readUntilChar('}')) {
+//              String macroStartTag;
+//
+//              macroStartTag = new String(fSource, startMacroPosition, fCurrentPosition - startMacroPosition - 1);
+//              if (macroStartTag != null) {
+//                createMacro(startMacroPosition, macroStartTag);
+//                continue;
+//              }
+//            }
           }
           break;
         case '<':