TSK-546 Extracted content Arabic files issue

fixes issue when content was escaped twice in some cases, if set node called multiple times on the same content (that should be looked at too)
This commit is contained in:
adam-m 2012-07-18 13:04:30 -04:00
parent b72faa5a00
commit 1fad291255

View File

@ -158,9 +158,9 @@ public class ExtractedContentViewer implements DataContentViewer {
@Override @Override
public String getMarkup() { public String getMarkup() {
try { try {
curContent = StringEscapeUtils.escapeHtml(getSolrContent(selectedNode, currentPage, hasChunks)); curContent = getSolrContent(selectedNode, currentPage, hasChunks);
curContent = "<pre>" + curContent.trim() + "</pre>"; String curContentTrimmed = "<pre>" + curContent.trim() + "</pre>";
return curContent; return curContentTrimmed;
} catch (SolrServerException ex) { } catch (SolrServerException ex) {
logger.log(Level.WARNING, "Couldn't get extracted content.", ex); logger.log(Level.WARNING, "Couldn't get extracted content.", ex);
return ""; return "";
@ -418,7 +418,10 @@ public class ExtractedContentViewer implements DataContentViewer {
//not cached //not cached
try { try {
curContent = solrServer.getSolrContent(contentObj, chunkId); curContent = StringEscapeUtils.escapeHtml(solrServer.getSolrContent(contentObj, chunkId)).trim();
StringBuilder sb = new StringBuilder(curContent.length() + 20);
sb.append("<pre>").append(curContent).append("</pre>");
curContent = sb.toString();
curContentId = contentId; curContentId = contentId;
curContentChunk = chunkId; curContentChunk = chunkId;
} catch (NoOpenCoreException ex) { } catch (NoOpenCoreException ex) {