There are 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-6820de37-1b97-4202-9bb7-3c68c26f6574 XWIKI-24993 Open

The anchor of a link to another page is dropped from the URL unless a query string is also set

 
View issue   ยท   Add comment
 

2 comments

 
cid:jira-generated-image-avatar-e9c6576d-b36e-41cc-951f-24e78b43a3ba Thomas Mortagne on 15/Sep/26 17:43
 

Links with an anchor and no query string are very common (xwiki.org if full of those) and I don't remember ever having this problem.

I tried on 17.10.9, and I still cannot reproduce what is described:

[[Main.WebHome||anchor="toto"]]

{{velocity}}
$xwiki.getURL('Main.WebHome', 'view', '', 'HTest')
{{/velocity}}

produces the following HTML

<p><span class="wikilink"><a href="/xwiki/bin/view/Main/#toto"><span class="wikigeneratedlinkcontent">Main</span></a></span></p><p>/xwiki/bin/view/Main/#HTest</p>

I think the problem is more what you used as example. AFAIR XWikiSyntax has a pretty special way to treating page content.

 
cid:jira-generated-image-avatar-e9c6576d-b36e-41cc-951f-24e78b43a3ba Thomas Mortagne on 15/Sep/26 17:43
 
Links with an anchor and no query string are very common (xwiki.org if full of those) and I don't remember ever having this problem.

I tried on 17.10.9, and I still cannot reproduce what is described:

{noformat}
[[Main.WebHome||anchor="toto"]]

{{velocity}}
$xwiki.getURL('Main.WebHome', 'view', '', 'HTest')
{{/velocity}}
{noformat}

produces the following HTML

{noformat}
<p><span class="wikilink"><a href="/xwiki/bin/view/Main/#toto"><span class="wikigeneratedlinkcontent">Main</span></a></span></p><p>/xwiki/bin/view/Main/#HTest</p>
{noformat}

I think the The problem is might be more what you used as example to test . AFAIR XWikiSyntax has a pretty special way to treating page content.