Actions
Defect #12981
closedWiki self-link with anchor looks strange in "preview" section.
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Wont fix
Affected version:
Description
My page named Wiki
contains link [[Wiki#Section]]
. It produces this HTML: <a href="#Section">Wiki</a>
that looks great on the page, but look strange in preview section, while editing this page. In that case it directs me to /projects/project1/wiki/Wiki/edit#Section
that is obviously wrong.
Self-link is considered like special case by this piece of code (app/helpers/application_helper.rb
):
def parse_wiki_links
# ...
url = if anchor.present? && wiki_page.present? && (obj.is_a?(WikiContent) || obj.is_a?(WikiContent::Version)) && obj.page == wiki_page
"##{anchor}"
else
As you can see, obj.page == wiki_page
is not enough to make link local.
Files
Related issues
Actions