summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/filter/table_of_contents_filter_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/banzai/filter/table_of_contents_filter_spec.rb')
-rw-r--r--spec/lib/banzai/filter/table_of_contents_filter_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb
index 5ca3c722e3e..05ef77c811a 100644
--- a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb
+++ b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb
@@ -82,7 +82,9 @@ describe Banzai::Filter::TableOfContentsFilter do
it 'supports Unicode' do
doc = filter(header(1, '한글'))
expect(doc.css('h1 a').first.attr('id')).to eq 'user-content-한글'
- expect(doc.css('h1 a').first.attr('href')).to eq '#한글'
+ # check that we encode the href to avoid issues with the
+ # ExternalLinkFilter (see https://gitlab.com/gitlab-org/gitlab/issues/26210)
+ expect(doc.css('h1 a').first.attr('href')).to eq "##{CGI.escape('한글')}"
end
end
end