diff --git a/source/net/yacy/search/snippet/TextSnippet.java b/source/net/yacy/search/snippet/TextSnippet.java index 163141a3e..fb19b266d 100644 --- a/source/net/yacy/search/snippet/TextSnippet.java +++ b/source/net/yacy/search/snippet/TextSnippet.java @@ -131,7 +131,7 @@ public class TextSnippet implements Comparable, Comparator, Comparator... tags are kept as is. + * Init a snippet line for urlhash * * @param urlhash hash of the url for this snippet * @param line text to use as snippet @@ -361,15 +359,7 @@ 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.line = line; this.isMarked = isMarked; this.resultStatus = errorCode; this.error = errortext; @@ -437,9 +427,22 @@ public class TextSnippet implements Comparable, Comparator.. + * + * @param queryGoal + * @return html encoded snippet line + */ public String descriptionline(QueryGoal queryGoal) { if (descriptionline != null) return descriptionline; - descriptionline = this.isMarked() ? this.getLineRaw() : this.getLineMarked(queryGoal); + if (this.isMarked) { + // html encode source, keep .. + descriptionline = CharacterCoding.unicode2html(this.getLineRaw(), false).replaceAll("<b>(.+?)</b>", "$1"); + } else { + descriptionline = this.getLineMarked(queryGoal); + } return descriptionline; }