# HG changeset patch # User ferrall@nwoca.org # Date 1296241954 18000 # Node ID c1d94c6238540b56441d201b7fa2b2c9e77ac7c3 # Parent 8f23347884c0b13093d44ce4e1bedc3df5851a5a diff -r 8f23347884c0 -r c1d94c623854 src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java --- a/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java Fri Jan 28 13:57:25 2011 -0500 +++ b/src/org/nwoca/ssdt/tools/html2wiki/Html2Wiki.java Fri Jan 28 14:12:34 2011 -0500 @@ -69,7 +69,7 @@ transformers.add(new TagTransformer("
(.*?)
", true, "{code}","{code}")); transformers.add(new TagTransformer("
(.*?)
", true, "{center}","{center}")); transformers.add(new TagTransformer("(.*?)", "*","*")); - transformers.add(new TagTransformer("(.*?)", "*","*")); + transformers.add(new TagTransformer("(.*?)", true, "*","*")); transformers.add(new TagTransformer("(.*?)" , "+","+")); transformers.add(new TagTransformer("(?s)(.*?)", "{{", "}}")); transformers.add(new TagTransformer("

(.*)

", "h1. ", "")); @@ -86,7 +86,7 @@ transformers.add(new ReplaceTransformer("\\{td\\}\\n\\s{2}\\{tr\\}\\n\\{table\\}\\n\\{center\\}","{info}")); //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("\\{table:.*\\}\\n\\s{2}\\{tr\\}\\n\\s{4}\\{td\\}\\n\\s{6}\\n{0,1}\\{code\\}","{code}")); transformers.add(new ReplaceTransformer("\\{code\\}\\n\\{td\\}\\{tr\\}\\{table\\}","{code}")); //Change borderStyle of code window for "screenshots" to none. @@ -97,10 +97,14 @@ transformers.add(new TagTransformer("
(.*?)
", true, "{quote}", "{quote}")); transformers.add(new DeleteTransformer("(?s)")); transformers.add(new ReflowTransformer("(\\{info\\})([^\\{]*)(\\{info\\})")); + transformers.add(new ReflowTransformer("(\\{note\\})([^\\{]*)(\\{note\\})")); + transformers.add(new ReflowTransformer("(\\{td\\})([^\\{]*)(\\{td\\})")); + transformers.add(new ReflowTransformer("(\\{li\\})([^\\{]*)(\\{li\\})")); transformers.add(new TagTransformer("(.*?)", true, "^\\[","\\]^ ")); transformers.add(new ReplaceTransformer("<","<")); transformers.add(new ReplaceTransformer(">",">")); transformers.add(new ReplaceTransformer(""","\"")); + transformers.add(new ReplaceTransformer("&","&")); transformers.add(new ReplaceTransformer(":\\)",": )")); // No smilies... transformers.add(new ReplaceTransformer("(\\w)(--)(\\w)"," -- ",2)); diff -r 8f23347884c0 -r c1d94c623854 src/org/nwoca/ssdt/tools/html2wiki/ReflowTransformer.java --- a/src/org/nwoca/ssdt/tools/html2wiki/ReflowTransformer.java Fri Jan 28 13:57:25 2011 -0500 +++ b/src/org/nwoca/ssdt/tools/html2wiki/ReflowTransformer.java Fri Jan 28 14:12:34 2011 -0500 @@ -5,10 +5,7 @@ class ReflowTransformer implements Transformer { private Pattern[] patterns = { - Pattern.compile("(\\n

)(.*?)(\\n\\n|\\n<)", Pattern.MULTILINE + Pattern.DOTALL), - Pattern.compile("(

  • )(.*?)(
  • )", Pattern.MULTILINE + Pattern.DOTALL), - Pattern.compile("()([^<]*)()", Pattern.MULTILINE + Pattern.DOTALL) - }; + Pattern.compile("(\\n

    )(.*?)(\\n\\n|\\n<)", Pattern.MULTILINE + Pattern.DOTALL)}; /** * Default transformer refolows paragraphs, li's and td's.