--- /dev/null
+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
--- /dev/null
+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("<blubber>...", filter.filter("<blubber>...", context));
+ }
+
+}
\ No newline at end of file
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;
}
// 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 '<':