From 16c714012f59883f569a7a3bb54f101dfb28d178 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 10 Jun 2015 14:42:14 +0930 Subject: [PATCH] Fix incorrect highlighting of post excerpts --- js/forum/src/components/post-preview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/forum/src/components/post-preview.js b/js/forum/src/components/post-preview.js index 592916cb9..30ace129a 100644 --- a/js/forum/src/components/post-preview.js +++ b/js/forum/src/components/post-preview.js @@ -12,14 +12,14 @@ export default class PostPreview extends Component { var excerpt = post.contentPlain(); var start = 0; - if (highlight) { + if (this.props.highlight) { var regexp = new RegExp(this.props.highlight, 'gi'); start = Math.max(0, excerpt.search(regexp) - 100); } excerpt = (start > 0 ? '...' : '')+excerpt.substring(start, start + 200)+(excerpt.length > start + 200 ? '...' : ''); - if (highlight) { + if (this.props.highlight) { excerpt = highlight(excerpt, regexp); }