changeset 15:494ca5643e1a

adjust h2 transformer for headings with arguments and added transformer for removing the empty contents table that is left as part of the conversion of the manuals.
author ferrall@nwoca.org
date Mon, 07 Feb 2011 11:44:10 -0500
parents c8442e0eff84
children 001e43423d5d
files src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java	Tue Feb 01 12:34:45 2011 -0500
+++ b/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java	Mon Feb 07 11:44:10 2011 -0500
@@ -42,9 +42,9 @@
         transformers.add(new DeleteTransformer("<font .*?>|</font>"));
         transformers.add(new CloseTagTransformer("<li>","(\n|\r)*(<li>|</ul>|</ol>|<ul>|<ol>)","</li>"));
         transformers.add(new BadTableDataTransformer());
-        transformers.add(new BadTableRowTransformer());
-        transformers.add(new ReflowTransformer());
-        transformers.add(new DeleteTransformer("<p>"));
+        transformers.add(new BadTableRowTransformer()); 
+        transformers.add(new ReflowTransformer()); 
+        transformers.add(new DeleteTransformer("<p>")); 
         transformers.add(new ReplaceTransformer("\\{","\\{"));  // Escape braces
         transformers.add(new ReplaceTransformer("\\}","\\}"));
 
@@ -75,7 +75,7 @@
         transformers.add(new TagTransformer("<u>(.*?)</u>" , "+","+"));
         transformers.add(new TagTransformer("(?s)<kbd>(.*?)</kbd>",  "{{", "}}"));
         transformers.add(new TagTransformer("<h1>(.*)</h1>",    "h1. ",      ""));
-        transformers.add(new TagTransformer("<h2>(.*)</h2>",    "h2. ",     ""));
+        transformers.add(new TagTransformer("<h2.*>(.*)</h2>",    "h2. ",     ""));
         transformers.add(new TagTransformer("<h3>(accessing the program|sample run|sample screens?|sample reports?)</[h|H]3>","h3.",    ""));
         transformers.add(new TagTransformer("<h3>(.*)</H3>",    "h3. ",         ""));
         transformers.add(new TagTransformer("<h3>(.*)</h3>",    "h3. ",        ""));
@@ -109,6 +109,7 @@
         transformers.add(new ReplaceTransformer("&amp;","&"));
         transformers.add(new ReplaceTransformer(":\\)",": )"));  // No smilies...
         transformers.add(new ReplaceTransformer("(\\w)(--)(\\w)"," -- ",2));  // avoid strikeout
+        transformers.add(new ReplaceTransformer("\\{table(.*?)\\}\\n\\s{2}\\{tr\\}\\n\\s{4}\\{td\\}Contents\\{td\\}\\n\\s{2}\\{tr\\}\\n\\{table\\}",""));  // remove "contents" table
 
     }