FIX: converts “ and ” to " in local dates (#10987)
This commit is contained in:
parent
f4842ae283
commit
6811902a70
|
@ -13,7 +13,7 @@ function addLocalDate(buffer, matches, state) {
|
||||||
countdown: null,
|
countdown: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const matchString = matches[1].replace(/„|“|«|»/g, '"');
|
const matchString = matches[1].replace(/„|“|«|»|“|”/g, '"');
|
||||||
|
|
||||||
let parsed = parseBBCodeTag(
|
let parsed = parseBBCodeTag(
|
||||||
"[date date" + matchString + "]",
|
"[date date" + matchString + "]",
|
||||||
|
|
|
@ -81,10 +81,19 @@ describe PrettyText do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'german quotes' do
|
context 'special quotes' do
|
||||||
let(:post) { Fabricate(:post, raw: '[date=2019-10-16 time=14:00:00 format="LLLL" timezone=„America/New_York“]') }
|
it 'converts special quotes to regular quotes' do
|
||||||
|
# german
|
||||||
|
post = Fabricate(:post, raw: '[date=2019-10-16 time=14:00:00 format="LLLL" timezone=„America/New_York“]')
|
||||||
|
excerpt = PrettyText.excerpt(post.cooked, 200)
|
||||||
|
expect(excerpt).to eq('Wednesday, October 16, 2019 6:00 PM (UTC)')
|
||||||
|
|
||||||
it 'converts german quotes to regular quotes' do
|
# french
|
||||||
|
post = Fabricate(:post, raw: '[date=2019-10-16 time=14:00:00 format="LLLL" timezone=«America/New_York»]')
|
||||||
|
excerpt = PrettyText.excerpt(post.cooked, 200)
|
||||||
|
expect(excerpt).to eq('Wednesday, October 16, 2019 6:00 PM (UTC)')
|
||||||
|
|
||||||
|
post = Fabricate(:post, raw: '[date=2019-10-16 time=14:00:00 format="LLLL" timezone=“America/New_York”]')
|
||||||
excerpt = PrettyText.excerpt(post.cooked, 200)
|
excerpt = PrettyText.excerpt(post.cooked, 200)
|
||||||
expect(excerpt).to eq('Wednesday, October 16, 2019 6:00 PM (UTC)')
|
expect(excerpt).to eq('Wednesday, October 16, 2019 6:00 PM (UTC)')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue