diff --git a/htroot/ViewProfile.java b/htroot/ViewProfile.java index 0af82f864..b9a47366e 100644 --- a/htroot/ViewProfile.java +++ b/htroot/ViewProfile.java @@ -55,7 +55,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Properties; -import de.anomic.data.wikiCode; import de.anomic.http.httpHeader; import de.anomic.kelondro.kelondroBase64Order; import de.anomic.plasma.plasmaSwitchboard; @@ -73,7 +72,6 @@ public class ViewProfile { // listManager.switchboard = (plasmaSwitchboard) env; serverObjects prop = new serverObjects(); plasmaSwitchboard switchboard = (plasmaSwitchboard) env; - wikiCode wikiTransformer = new wikiCode(switchboard); boolean authenticated = switchboard.adminAuthenticated(header) >= 2; int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0); prop.put("display", display); @@ -175,9 +173,9 @@ public class ViewProfile { prop.put("success_" + key, 1); // only comments get "wikified" if(key.equals("comment")){ - prop.putASIS( + prop.putWiki( "success_" + key + "_value", - wikiTransformer.transform(((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n")) + ((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n") ); prop.putASIS("success_" + key + "_b64value",kelondroBase64Order.standardCoder.encodeString((String) entry.getValue())); }else{ diff --git a/source/de/anomic/data/wiki/knwikiParser.java b/source/de/anomic/data/wiki/knwikiParser.java index 7bbfd66ef..eb502ca77 100644 --- a/source/de/anomic/data/wiki/knwikiParser.java +++ b/source/de/anomic/data/wiki/knwikiParser.java @@ -62,34 +62,12 @@ import de.anomic.yacy.yacyCore; public class knwikiParser implements wikiParser { - public final Token[] tokens; - private final String[] BEs; + public Token[] tokens; + private String[] BEs; + private final plasmaSwitchboard sb; public knwikiParser(plasmaSwitchboard sb) { - tokens = new Token[] { - new SimpleToken('=', '=', new String[][] { null, { "h2" }, { "h3" }, { "h4" } }, true), - new SimpleToken('\'', '\'', new String[][] { null, { "i" }, { "b" }, null, { "b", "i" } }, false), - new LinkToken(yacyCore.seedDB.mySeed.getPublicAddress(), "Wiki.html?page=", sb), - new ListToken('*', "ul"), - new ListToken('#', "ol"), - new ListToken(':', "blockquote", null), - new ListToken(' ', null, "tt", false), - new DefinitionListToken(), - new TableToken() - }; - ArrayList r = new ArrayList(); - for (int i=0, k, j; i 1) { - r.add(tokens[i].getBlockElementNames()[j].substring(0, k)); - } else { - r.add(tokens[i].getBlockElementNames()[j]); - } - } - r.add("hr"); - BEs = (String[])r.toArray(new String[r.size()]); + this.sb = sb; } public static void main(String[] args) { @@ -157,6 +135,31 @@ public class knwikiParser implements wikiParser { } public String parse(String text) { + tokens = new Token[] { + new SimpleToken('=', '=', new String[][] { null, { "h2" }, { "h3" }, { "h4" } }, true), + new SimpleToken('\'', '\'', new String[][] { null, { "i" }, { "b" }, null, { "b", "i" } }, false), + new LinkToken(yacyCore.seedDB.mySeed.getPublicAddress(), "Wiki.html?page=", sb), + new ListToken('*', "ul"), + new ListToken('#', "ol"), + new ListToken(':', "blockquote", null), + new ListToken(' ', null, "tt", false), + new DefinitionListToken(), + new TableToken() + }; + ArrayList r = new ArrayList(); + for (int i=0, k, j; i 1) { + r.add(tokens[i].getBlockElementNames()[j].substring(0, k)); + } else { + r.add(tokens[i].getBlockElementNames()[j]); + } + } + r.add("hr"); + BEs = (String[])r.toArray(new String[r.size()]); + Text[] tt = Text.split2Texts(text, "[=", "=]"); for (int i=0; i