Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…p=5979#p5979

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4513 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Feb 26, 2008
1 parent 096d0f7 commit 3f2b18a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions htroot/ViewFile.java
Expand Up @@ -241,6 +241,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("viewMode", VIEW_MODE_NO_TEXT);
return prop;
}

String[] wordArray = wordArray(post.get("words", null));

if (viewMode.equals("plain")) {

Expand All @@ -262,11 +264,9 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}
}

content = content.replaceAll("\n", "<br />").replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");

prop.put("error", "0");
prop.put("viewMode", VIEW_MODE_AS_PLAIN_TEXT);
prop.putHTML("viewMode_plainText", content);
prop.put("viewMode_plainText", markup(wordArray, content).replaceAll("\n", "<br />").replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;"));

} else if (viewMode.equals("iframe")) {
prop.put("viewMode", VIEW_MODE_AS_IFRAME);
Expand Down Expand Up @@ -298,15 +298,13 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}

resMime = document.dc_format();
String[] wordArray = wordArray(post.get("words", null));


if (viewMode.equals("parsed")) {
String content = new String(document.getTextBytes());
// content = wikiCode.replaceHTML(content); // added by Marc Nause
content = content.replaceAll("\n", "<br />").replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");

prop.put("viewMode", VIEW_MODE_AS_PARSED_TEXT);
prop.put("viewMode_parsedText", markup(wordArray, content));
prop.put("viewMode_parsedText", markup(wordArray, content).replaceAll("\n", "<br />").replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;"));

} else if (viewMode.equals("sentences")) {
prop.put("viewMode", VIEW_MODE_AS_PARSED_SENTENCES);
Expand Down

0 comments on commit 3f2b18a

Please sign in to comment.