]> cat aescling's git repositories - mastodon.git/commitdiff
Skip formatting for cashtag in status text (#3275)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Wed, 24 May 2017 12:32:53 +0000 (21:32 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 24 May 2017 12:32:53 +0000 (14:32 +0200)
Resolve #3270

app/lib/extractor.rb
spec/lib/formatter_spec.rb

index c582b5e4dec9d202d551de2327ba69625deb5c45..957364293d73a5e2e9eae6cd0610e2c395b12500 100644 (file)
@@ -56,4 +56,8 @@ module Extractor
     tags.each { |tag| yield tag[:hashtag], tag[:indices].first, tag[:indices].last } if block_given?
     tags
   end
+
+  def extract_cashtags_with_indices(_text)
+    [] # always returns empty array
+  end
 end
index 1db7f0bc971e411c38f45692de7d5dc8600c035f..2e0f111103b7725e50a75f2d6d3ae44ca9525a71 100644 (file)
@@ -46,6 +46,14 @@ RSpec.describe Formatter do
       end
     end
 
+    context 'with cashtag' do
+      let(:local_text) { 'Hello world $AAPL' }
+
+      it 'skip cashtag' do
+        expect(subject).to match '<p>Hello world $AAPL</p>'
+      end
+    end
+
     context 'with reblog' do
       let(:local_status) { Fabricate(:status, account: account, reblog: Fabricate(:status, text: 'Hello world', account: account)) }