# HG changeset patch
# User ferrall@nwoca.org
# Date 1296220829 18000
# Node ID e8ea26ab2cd795aad52e57620de00e2ec4faefa6
# Parent a634b4d554d4c45cfe94603c5a6b26e60ceecda7
[no commit message]
diff -r a634b4d554d4 -r e8ea26ab2cd7 src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java
--- a/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java Thu Jan 27 18:07:28 2011 -0500
+++ b/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java Fri Jan 28 08:20:29 2011 -0500
@@ -37,7 +37,6 @@
transformers.add(new DeleteTransformer("(\\n|\\r)*",true));
transformers.add(new DeleteTransformer("|"));
transformers.add(new DeleteTransformer("(?m)^\\*"));
-// transformers.add(new DeleteTransformer("
|
"));
transformers.add(new DeleteTransformer("(?m)
$"));
transformers.add(new DeleteTransformer("|"));
transformers.add(new CloseTagTransformer("","(\n|\r)*(|||"));
@@ -45,15 +44,18 @@
transformers.add(new BadTableRowTransformer());
transformers.add(new ReflowTransformer());
transformers.add(new DeleteTransformer(""));
-// transformers.add(new ReplaceTransformer("","\n"));
- transformers.add(new ReplaceTransformer("\\{","\\{")); // Escape braces
- transformers.add(new ReplaceTransformer("\\}","\\}"));
+ transformers.add(new ReplaceTransformer("\\{","\\{")); // Escape braces
+ transformers.add(new ReplaceTransformer("\\}","\\}"));
transformers.add(new ReplaceTransformer("\\[","\\[")); // Escape brackets
transformers.add(new ReplaceTransformer("\\]","\\]"));
transformers.add(new PreTagTransformer()); // Unescape brackets inside
//
transformers.add(new ReplaceTransformer("
","\\\\"));
+
+ //replace table tag preserving border setting.
+ transformers.add(new TagTransformer("
", true, "{table:border=","}"));
+
transformers.add(new ReplaceTransformer("|
","{table}"));
transformers.add(new ReplaceTransformer("|
","{tr}"));
transformers.add(new ReplaceTransformer("|","{td}"));
@@ -77,14 +79,23 @@
transformers.add(new TagTransformer("(.*)
", "h4. ", ""));
transformers.add(new TagTransformer("(.*)
", "h5. ", ""));
transformers.add(new TagTransformer("(.*)
", "h6. ", ""));
- transformers.add(new ReplaceTransformer("\\{center}\\n\\{table}\\n\\{tr\\}\\n\\s{2}\\{td\\}\\{center\\}\\*Note\\*\\{center\\}","{note}"));
- transformers.add(new ReplaceTransformer("\\{td\\}\\n\\s{2}\\{tr\\}\\n\\{table\\}\\n\\{center\\}","{note}"));
+
+ //Replace Notes with Info tags.
+ transformers.add(new ReplaceTransformer("\\{center}\\n\\{table:border=\\d}\\n\\{tr\\}\\n\\s{2}\\{td\\}\\{center\\}\\*Note\\*\\{center\\}","{info}"));
+ transformers.add(new ReplaceTransformer("\\{td\\}\\n\\s{2}\\{tr\\}\\n\\{table\\}\\n\\{center\\}","{info}"));
-// transformers.add(new TagTransformer("\\{center}\\n\\{table}\\n\\{tr\\}\\n\\s{2}\\{td\\}\\{center\\}\\*Note\\*\\{center\\}(.*?)\\s\\{td\\}\\n\\s{2}\\{tr\\}\\{table\\}", "{note}", "{note}"));
-// transformers.add(new TagTransformer("(\\S)\\s\\n", "", " "));
+ //Remove unnecessary table surrounding code blocks.
+ transformers.add(new ReplaceTransformer("\\{table:.*\\}\\n\\s{2}\\{tr\\}\\n\\s{4}\\{td\\}\\n\\s{6}\\n\\{code\\}","{code}"));
+ transformers.add(new ReplaceTransformer("\\{code\\}\\n\\{td\\}\\{tr\\}\\{table\\}","{code}"));
+
+ //Change borderStyle of code window for "screenshots" to none.
+ transformers.add(new TagTransformer("\\{code\\}([\\s\\n]*?_______________)", true, "{code:borderStyle=none}", ""));
+
+
+
transformers.add(new TagTransformer("(.*?)
", true, "{quote}", "{quote}"));
transformers.add(new DeleteTransformer("(?s)"));
- transformers.add(new ReflowTransformer("(\\{note\\})([^\\{]*)(\\{note\\})"));
+ transformers.add(new ReflowTransformer("(\\{info\\})([^\\{]*)(\\{info\\})"));
transformers.add(new TagTransformer("(.*?)", true, "^\\[","\\]^ "));
transformers.add(new ReplaceTransformer("<","<"));
transformers.add(new ReplaceTransformer(">",">"));