From fba34e12eff63b75d88e45b2bd521131976685cb Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 15 Feb 2015 20:39:20 +0100 Subject: [PATCH] fix formatting issue if snippet contains html code replacement for reverted commit https://gitorious.org/yacy/rc1/commit/61f42a792872c7fc83c7d4d64e1f0bb9d063c810 --- .../net/yacy/search/snippet/TextSnippet.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/search/snippet/TextSnippet.java b/source/net/yacy/search/snippet/TextSnippet.java index 9b516922b..163141a3e 100644 --- a/source/net/yacy/search/snippet/TextSnippet.java +++ b/source/net/yacy/search/snippet/TextSnippet.java @@ -343,6 +343,17 @@ public class TextSnippet implements Comparable, Comparator... tags are kept as is. + * + * @param urlhash hash of the url for this snippet + * @param line text to use as snippet + * @param isMarked true if query words already marked in input text + * @param errorCode + * @param errortext + */ private void init( final byte[] urlhash, final String line, @@ -350,7 +361,15 @@ public class TextSnippet implements Comparable, Comparator... html tags in place + this.line = CharacterCoding.unicode2html(line, false).replaceAll("<b>(.+?)</b>", "$1"); + } else { // otherwise encode all text for html display + this.line = CharacterCoding.unicode2html(line, false); + } + } else { + this.line = line; + } this.isMarked = isMarked; this.resultStatus = errorCode; this.error = errortext;