0
0
Fork 0

Change RTL detection to rely on unicode-bidi paragraph by paragraph (#14573)

This commit is contained in:
Eugen Rochko 2020-12-15 12:56:43 +01:00 committed by GitHub
parent 1045549f85
commit 1f564051b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 26 additions and 106 deletions

View file

@ -149,22 +149,4 @@ RSpec.describe StatusesHelper, type: :helper do
expect(css_class).to eq 'h-cite'
end
end
describe '#rtl?' do
it 'is false if text is empty' do
expect(helper).not_to be_rtl ''
end
it 'is false if there are no right to left characters' do
expect(helper).not_to be_rtl 'hello world'
end
it 'is false if right to left characters are fewer than 1/3 of total text' do
expect(helper).not_to be_rtl 'hello ݟ world'
end
it 'is true if right to left characters are greater than 1/3 of total text' do
expect(helper).to be_rtl 'aaݟaaݟ'
end
end
end