From 5e3a120120720e42759960e246caea6928571ffb Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 17 Jul 2019 01:29:33 -0500 Subject: [PATCH] fix parsing of tags for folding --- app/services/post_status_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index dd4c801bd..6f4be1cfe 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -106,8 +106,8 @@ class PostStatusService < BaseService def extract_tags chunks = [] @text.split(/^((?:#[\w:._·\-]+\s*)+)/).each do |chunk| - if chunk.start_with?('#') && !chunk.start_with?('#!') - @tags |= chunk[1..-1].split(/\s+/) + if chunk.match?(/\A#[\w:._·\-]/) + @tags |= chunk.strip.gsub('#', '').split(/\s+/) else chunks << chunk end