diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-09-08 04:21:30 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-09-08 04:21:30 +0000 |
commit | 1d4785470db018d46fc247d1d11e12aa25352c08 (patch) | |
tree | c78be9d59d176ef0a5ba42d570b799209f1f4156 /spec/lib/banzai/pipeline | |
parent | 6d1b5850342a91ebdff07bb57722ce28e31b773f (diff) | |
download | gitlab-ce-1d4785470db018d46fc247d1d11e12aa25352c08.tar.gz |
Resolve "Process urls with spaces in all markdown processing"
Diffstat (limited to 'spec/lib/banzai/pipeline')
-rw-r--r-- | spec/lib/banzai/pipeline/gfm_pipeline_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb index 75413596431..df24cef0b8b 100644 --- a/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb +++ b/spec/lib/banzai/pipeline/gfm_pipeline_spec.rb @@ -87,4 +87,22 @@ describe Banzai::Pipeline::GfmPipeline do end end end + + describe 'markdown link or image urls having spaces' do + let(:project) { create(:project, :public) } + + it 'rewrites links with spaces in url' do + markdown = "[Link to Page](page slug)" + output = described_class.to_html(markdown, project: project) + + expect(output).to include("href=\"page%20slug\"") + end + + it 'rewrites images with spaces in url' do + markdown = "![My Image](test image.png)" + output = described_class.to_html(markdown, project: project) + + expect(output).to include("src=\"test%20image.png\"") + end + end end |