diff --git a/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 b/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 index 103bd3e3124..b99eca3fe3a 100644 --- a/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 +++ b/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 @@ -13,7 +13,7 @@ function addLocalDate(buffer, matches, state) { countdown: null, }; - const matchString = matches[1].replace(/„|“|«|»/g, '"'); + const matchString = matches[1].replace(/„|“|«|»|“|”/g, '"'); let parsed = parseBBCodeTag( "[date date" + matchString + "]", diff --git a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb index a002553c05a..d90d26da356 100644 --- a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb +++ b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb @@ -81,10 +81,19 @@ describe PrettyText do end end - context 'german quotes' do - let(:post) { Fabricate(:post, raw: '[date=2019-10-16 time=14:00:00 format="LLLL" timezone=„America/New_York“]') } + context 'special quotes' do + 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) expect(excerpt).to eq('Wednesday, October 16, 2019 6:00 PM (UTC)') end