Better way to show invisible space is by using unicode code points instead of utf-8 characters.

This commit is contained in:
Samuel Clay 2021-07-05 11:52:29 -04:00
parent 889caf82a4
commit cb1f168812

View file

@ -51,7 +51,7 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
// First do a naive strip, which is faster than rendering which makes network calls
content = content && content.replace(/<(?:.|\n)*?>/gm, ' ');
content = content && Inflector.stripTags(content);
content = content && content.replace(/ /g, ' '); // Invisible space, boo
content = content && content.replace(/[\u00a0\u200c]/g, ' '); // Invisible space, boo
content = content && content.replace(/\s+/gm, ' ');
return _.string.prune(_.string.trim(content), length || 150, "...");