Skip formatting for cashtag in status text (#3275)

Resolve #3270
This commit is contained in:
Yamagishi Kazutoshi 2017-05-24 21:32:53 +09:00 committed by Eugen Rochko
parent be83d450eb
commit f937cad68f
2 changed files with 12 additions and 0 deletions

View File

@ -56,4 +56,8 @@ module Extractor
tags.each { |tag| yield tag[:hashtag], tag[:indices].first, tag[:indices].last } if block_given? tags.each { |tag| yield tag[:hashtag], tag[:indices].first, tag[:indices].last } if block_given?
tags tags
end end
def extract_cashtags_with_indices(_text)
[] # always returns empty array
end
end end

View File

@ -46,6 +46,14 @@ RSpec.describe Formatter do
end end
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 context 'with reblog' do
let(:local_status) { Fabricate(:status, account: account, reblog: Fabricate(:status, text: 'Hello world', account: account)) } let(:local_status) { Fabricate(:status, account: account, reblog: Fabricate(:status, text: 'Hello world', account: account)) }