プロジェクト

全般

プロフィール

Vote #75028

完了

Allow to link to an anchor of the current wikipage

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
99
issue_org_id:
16313
author_id:
2784
assigned_to_id:
332
comments:
15
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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":https://plan.io adds the possibility to link directly to an anchor using the following syntax:


journals

I think the proposed behavior is more natural than the current behavior. Setting target version to 4.1.0.
--------------------------------------------------------------------------------
Tests for this feature.
--------------------------------------------------------------------------------
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.

!{width: 410px; border: 1px solid #ccc}.16313-confusing-link@2x.png!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed. Thank you for sharing the patch.

--------------------------------------------------------------------------------
It would be better to update documents as well. I will make a patch to update documents for all languages.

<pre><code class="diff">
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>

</pre>
--------------------------------------------------------------------------------
Please push to Github.

Thanks.
--------------------------------------------------------------------------------
Here is a patch for "Wiki formatting" documents.
--------------------------------------------------------------------------------
Updated the patch for help files. I hadn't updated wiki_syntax_detailed_textile.html for fr, ru and zh.
--------------------------------------------------------------------------------
Updated wiki help.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,17455,Easier anchor linking / Textile anchor links
relates,Closed,28998,Japanese wiki help translation update (r17367)
relates,Closed,12981,Wiki self-link with anchor looks strange in "preview" section.
duplicates,Closed,18043,Links to anchors inside the page should be pagename-independent

Admin Redmine さんが3年以上前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョン4.0.0_99 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0