提交 c66d8c89 编写于 作者: J Joey Robichaud

Remove additive classifications when generating ClassifiedText from ClassifiedSpans

上级 1754aa4e
......@@ -69,7 +69,12 @@ protected override IList<System.Windows.Documents.Inline> CreateLineTextInlines(
.GetProperties(propertyId);
var highlightBrush = properties["Background"] as Brush;
var classifiedSpans = _excerptResult.ClassifiedSpans;
// Remove additive classified spans before creating classified text.
// Otherwise the text will be repeated since there are two classifications
// for the same span. Additive classifications should not change the foreground
// color, so the resulting classified text will retain the proper look.
var classifiedSpans = _excerptResult.ClassifiedSpans.WhereAsArray(
cs => !ClassificationTypeNames.AdditiveTypeNames.Contains(cs.ClassificationType));
var classifiedTexts = classifiedSpans.SelectAsArray(
cs => new ClassifiedText(cs.ClassificationType, _excerptResult.Content.ToString(cs.TextSpan)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册