Commit a306cda7 authored by Bryce Johnson's avatar Bryce Johnson

Merge branch 'master' into merge-request-push-compare-ui

parents 2efcdcd0 0a8b6630
*.erb *.erb
lib/gitlab/sanitizers/svg/whitelist.rb
...@@ -209,8 +209,12 @@ rubocop: *exec ...@@ -209,8 +209,12 @@ rubocop: *exec
rake haml_lint: *exec rake haml_lint: *exec
rake scss_lint: *exec rake scss_lint: *exec
rake brakeman: *exec rake brakeman: *exec
rake flog: *exec rake flog:
rake flay: *exec <<: *exec
allow_failure: yes
rake flay:
<<: *exec
allow_failure: yes
license_finder: *exec license_finder: *exec
rake downtime_check: *exec rake downtime_check: *exec
......
...@@ -130,6 +130,7 @@ v 8.12.0 (unreleased) ...@@ -130,6 +130,7 @@ v 8.12.0 (unreleased)
- Allow bulk update merge requests from merge requests index page - Allow bulk update merge requests from merge requests index page
- Add notification_settings API calls !5632 (mahcsig) - Add notification_settings API calls !5632 (mahcsig)
- Remove duplication between project builds and admin builds view !5680 (Katarzyna Kobierska Ula Budziszewska) - Remove duplication between project builds and admin builds view !5680 (Katarzyna Kobierska Ula Budziszewska)
- Fix URLs with anchors in wiki !6300 (houqp)
- Deleting source project with existing fork link will close all related merge requests !6177 (Katarzyna Kobierska Ula Budziszeska) - Deleting source project with existing fork link will close all related merge requests !6177 (Katarzyna Kobierska Ula Budziszeska)
- Return 204 instead of 404 for /ci/api/v1/builds/register.json if no builds are scheduled for a runner !6225 - Return 204 instead of 404 for /ci/api/v1/builds/register.json if no builds are scheduled for a runner !6225
- Fix Gitlab::Popen.popen thread-safety issue - Fix Gitlab::Popen.popen thread-safety issue
......
...@@ -31,6 +31,7 @@ module Banzai ...@@ -31,6 +31,7 @@ module Banzai
def apply_relative_link_rules! def apply_relative_link_rules!
if @uri.relative? && @uri.path.present? if @uri.relative? && @uri.path.present?
link = ::File.join(@wiki_base_path, @uri.path) link = ::File.join(@wiki_base_path, @uri.path)
link = "#{link}##{@uri.fragment}" if @uri.fragment
@uri = Addressable::URI.parse(link) @uri = Addressable::URI.parse(link)
end end
end end
......
...@@ -127,6 +127,13 @@ describe Banzai::Pipeline::WikiPipeline do ...@@ -127,6 +127,13 @@ describe Banzai::Pipeline::WikiPipeline do
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/nested/twice/page.md\"") expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/nested/twice/page.md\"")
end end
it 'rewrites links with anchor' do
markdown = '[Link to Header](start-page#title)'
output = described_class.to_html(markdown, project: project, project_wiki: project_wiki, page_slug: page.slug)
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/start-page#title\"")
end
end end
describe "when creating root links" do describe "when creating root links" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment