From a281110b2908f55b6750c6ad72374c12b35dea15 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Thu, 17 Mar 2022 16:44:27 -0700 Subject: [PATCH] Add test of markdown link protocol sanitization --- spec/helpers/format_helper_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/helpers/format_helper_spec.rb b/spec/helpers/format_helper_spec.rb index 21198ffa..288d8441 100644 --- a/spec/helpers/format_helper_spec.rb +++ b/spec/helpers/format_helper_spec.rb @@ -9,6 +9,10 @@ describe FormatHelper, type: :helper do expect(markdown(nil)).to eq '' end + it "doesn't render unsafe URI schemes" do + expect(markdown('[a](javascript:b)')).to eq "

a

\n" + end + it 'should return HTML for header markdown' do expect(markdown('# this is my header')).to eq "

this is my header

\n" end