diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-09-24 20:44:05 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-09-24 20:44:05 -0500 |
commit | eb05eea843686e42f6d96492ee20856259b28281 (patch) | |
tree | d30bb4b5c53ac148da9cdfb2b44d82907c695c67 /app/services | |
parent | 5fdd29f80fe0020629129767bb0633fe84f55da3 (diff) |
strip blankspace when converting in-body tags to out-of-body tags
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/post_status_service.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index 572f91d51..47d127386 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -135,13 +135,10 @@ class PostStatusService < BaseService def extract_tags return unless '#'.in?(@text) @text = @text.dup if @text.frozen? - @text.gsub!(/^##/, "\uf666") - @text.gsub!('##', "\uf669") + @text.gsub!(/^##/, "\uf666").gsub!('##', "\uf669") @tags |= Extractor.extract_hashtags(@text) - @text.strip! - @text.gsub!(/^(?:#[\w:._·\-]+\s*)+$/, '') - @text.gsub!("\uf669", "##") - @text.gsub!("\uf666", "#") + @text.strip!.gsub!(/^(?:#[\w:._·\-]+\s*)+$/, '').strip! + @text.gsub!("\uf669", "##").gsub!("\uf666", "#") end def preprocess_attributes! |