Patch #16313
Allow to link to an anchor of the current wikipage
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Text formatting | |||
Target version: | 4.0.0 |
Description
Currently, it is not possible to link to an anchor of the current wiki page without having to also mention the name of the current wiki page in the link. This becomes tedious quickly if there are many such links. Should the wiki page later be moved, these inline links become quickly obsolete.
The attached patch which we developed for one of our customers at Planio adds the possibility to link directly to an anchor using the following syntax:
- simple link:
[[#Anchor]]
- link with custom text:
[[#Anchor|Link Text]]
Related issues
Associated revisions
Allow to link to an anchor of the current wiki page (#16313).
Patch by Holger Just.
Updates wiki help: Link to an anchor of the current wikipage (#16313).
Patch by Go MAEDA.
History
#1
Updated by Go MAEDA over 4 years ago
- Target version set to 4.1.0
I think the proposed behavior is more natural than the current behavior. Setting target version to 4.1.0.
#3
Updated by Go MAEDA over 4 years ago
- File 16313-confusing-link@2x.png added
I found that the patch generates a confusing link in some cases. If an anchor consists of only numeric characters, the generated link looks like an issue.
#4
Updated by Go MAEDA about 4 years ago
- Related to Feature #17455: Easier anchor linking / Textile anchor links added
#5
Updated by Go MAEDA about 4 years ago
Go MAEDA wrote:
I found that the patch generates a confusing link in some cases. If an anchor consists of only numeric characters, the generated link looks like an issue.
Does anyone have any comments on this behavior? I think this is acceptable because people rarely create wiki pages with such names.
#6
Updated by Go MAEDA about 4 years ago
- Subject changed from Allow to link to an achor of the current wikipage to Allow to link to an anchor of the current wikipage
- Assignee set to Go MAEDA
#7
Updated by Go MAEDA about 4 years ago
- Status changed from New to Closed
- Target version changed from 4.1.0 to 4.0.0
Committed. Thank you for sharing the patch.
#8
Updated by Go MAEDA about 4 years ago
- Status changed from Closed to Reopened
It would be better to update documents as well. I will make a patch to update documents for all languages.
Index: public/help/en/wiki_syntax_detailed_markdown.html
===================================================================
--- public/help/en/wiki_syntax_detailed_markdown.html (revision 17345)
+++ public/help/en/wiki_syntax_detailed_markdown.html (working copy)
@@ -24,6 +24,7 @@
<ul>
<li><strong>[[Guide]]</strong> displays a link to the page named 'Guide': <a href="#" class="wiki-page">Guide</a></li>
<li><strong>[[Guide#further-reading]]</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <a href="#" class="wiki-page">Guide</a></li>
+ <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
<li><strong>[[Guide|User manual]]</strong> displays a link to the same page but with a different text: <a href="#" class="wiki-page">User manual</a></li>
</ul>
Index: public/help/en/wiki_syntax_detailed_textile.html
===================================================================
--- public/help/en/wiki_syntax_detailed_textile.html (revision 17345)
+++ public/help/en/wiki_syntax_detailed_textile.html (working copy)
@@ -24,6 +24,7 @@
<ul>
<li><strong>[[Guide]]</strong> displays a link to the page named 'Guide': <a href="#" class="wiki-page">Guide</a></li>
<li><strong>[[Guide#further-reading]]</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <a href="#" class="wiki-page">Guide</a></li>
+ <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
<li><strong>[[Guide|User manual]]</strong> displays a link to the same page but with a different text: <a href="#" class="wiki-page">User manual</a></li>
</ul>
#9
Updated by Enziin System about 4 years ago
Please push to Github.
Thanks.
#10
Updated by Go MAEDA about 4 years ago
- File 16313-update-help.diff
added
Here is a patch for "Wiki formatting" documents.
#11
Updated by Go MAEDA about 4 years ago
- File 16313-update-help-v2.diff
added
Updated the patch for help files. I hadn't updated wiki_syntax_detailed_textile.html for fr, ru and zh.
#13
Updated by Go MAEDA about 4 years ago
- Related to Patch #28998: Japanese wiki help translation update (r17367) added
#14
Updated by Go MAEDA over 2 years ago
- Duplicated by Feature #18043: Links to anchors inside the page should be pagename-independent added
#15
Updated by Go MAEDA about 1 year ago
- Related to Defect #12981: Wiki self-link with anchor looks strange in "preview" section. added