mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-21 02:52:03 +00:00
Allow to link to an anchor of the current wiki page (#16313).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@17345 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8ba08c76ff
commit
e81043b1ee
@ -740,6 +740,12 @@ module ApplicationHelper
|
||||
link_project = project
|
||||
esc, all, page, title = $1, $2, $3, $5
|
||||
if esc.nil?
|
||||
if page =~ /^\#(.+)$/
|
||||
anchor = sanitize_anchor_name($1)
|
||||
url = "##{anchor}"
|
||||
next link_to(title.present? ? title.html_safe : h(page), url, :class => 'wiki-page')
|
||||
end
|
||||
|
||||
if page =~ /^([^\:]+)\:(.*)$/
|
||||
identifier, page = $1, $2
|
||||
link_project = Project.find_by_identifier(identifier) || Project.find_by_name(identifier)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user