mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: strip zero width spaces from topic title
This commit is contained in:
parent
677e126fbf
commit
a4bc54a686
2 changed files with 9 additions and 1 deletions
|
@ -17,7 +17,8 @@ class TextCleaner
|
|||
remove_all_periods_from_the_end: SiteSetting.title_prettify,
|
||||
remove_extraneous_space: SiteSetting.title_prettify && SiteSetting.default_locale == "en",
|
||||
fixes_interior_spaces: true,
|
||||
strip_whitespaces: true
|
||||
strip_whitespaces: true,
|
||||
strip_zero_width_spaces: true
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -47,6 +48,8 @@ class TextCleaner
|
|||
text = normalize_whitespaces(text)
|
||||
# Strip whitespaces
|
||||
text.strip! if opts[:strip_whitespaces]
|
||||
# Strip zero width spaces
|
||||
text.gsub!(/\u200b/, '') if opts[:strip_zero_width_spaces]
|
||||
|
||||
text
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue