Bladeren bron

Skip formatting for cashtag in status text (#3275)

Resolve #3270
master
Yamagishi Kazutoshi 7 jaren geleden
committed by Eugen Rochko
bovenliggende
commit
f937cad68f
2 gewijzigde bestanden met toevoegingen van 12 en 0 verwijderingen
  1. +4
    -0
      app/lib/extractor.rb
  2. +8
    -0
      spec/lib/formatter_spec.rb

+ 4
- 0
app/lib/extractor.rb Bestand weergeven

@@ -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

+ 8
- 0
spec/lib/formatter_spec.rb Bestand weergeven

@@ -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)) }



Laden…
Annuleren
Opslaan