mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: remove superfluous spaces from CJK blurbs (#12629)
Previously we used the raw data indexed to generate blurbs even for cases when Chinese/Korean/Japanese text was used. This caused superfluous spaces to show up in excerpts.
This commit is contained in:
@@ -87,7 +87,7 @@ class Search
|
||||
blurb_length: @blurb_length
|
||||
}
|
||||
|
||||
if post.post_search_data.version > SearchIndexer::MIN_POST_REINDEX_VERSION
|
||||
if post.post_search_data.version > SearchIndexer::MIN_POST_REINDEX_VERSION && !Search.segment_cjk?
|
||||
if SiteSetting.use_pg_headlines_for_excerpt
|
||||
scrubbed_headline = post.headline.gsub(SCRUB_HEADLINE_REGEXP, '\1')
|
||||
prefix_omission = scrubbed_headline.start_with?(post.leading_raw_data) ? '' : OMISSION
|
||||
|
||||
Reference in New Issue
Block a user