Change RTL detection to rely on unicode-bidi paragraph by paragraph (#14573)
This commit is contained in:
parent
1045549f85
commit
1f564051b6
12 changed files with 26 additions and 106 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue