You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2020/01/23 15:53:00 UTC

[jira] [Updated] (DOXIATOOLS-59) Link checker not handling anchors of fluido skin topbar very well

     [ https://issues.apache.org/jira/browse/DOXIATOOLS-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold updated DOXIATOOLS-59:
--------------------------------------------
    Issue Type: Bug  (was: Improvement)

> Link checker not handling anchors of fluido skin topbar very well
> -----------------------------------------------------------------
>
>                 Key: DOXIATOOLS-59
>                 URL: https://issues.apache.org/jira/browse/DOXIATOOLS-59
>             Project: Maven Doxia Tools
>          Issue Type: Bug
>          Components: Doxia Linkcheck
>    Affects Versions: doxia-linkcheck-1.2
>            Reporter: Alix Lourme
>            Priority: Minor
>              Labels: up-for-grabs
>         Attachments: bugfix.zip
>
>
> When you are using [maven-fluido-skin|https://maven.apache.org/skins/maven-fluido-skin/] with [topbar|https://maven.apache.org/skins/maven-fluido-skin/topbar/index.html], category menus are produced with a *single anchor* (*#*) like that:
> {code}
> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
> {code}
> In this case, _maven-linkcheck-plugin_ fails. You can simply reproduce the problem with this _site.xml_:
> {code}
> <project>
>   <skin>
>     <groupId>org.apache.maven.skins</groupId>
>     <artifactId>maven-fluido-skin</artifactId>
>     <version>1.7</version>
>   </skin>
>   <custom>
>     <fluidoSkin>
>       <topBarEnabled>true</topBarEnabled>
>       <sideBarEnabled>false</sideBarEnabled>
>     </fluidoSkin>
>   </custom>
>   <body>
>     <menu name="Overview">
>       <item name="Apache" href="http://www.apache.org" />
>       <item name="Maven" href="https://maven.apache.org" />
>     </menu>
>   </body>
> </project>
> {code}
> ----
> You can use *excludedLink* property, but the pattern to use in 
> [LinkValidatorManager.matchPattern|https://github.com/apache/maven-doxia-linkcheck/blob/1afc9f52cecea900b0c21926973afc5460c7a12e/src/main/java/org/apache/maven/doxia/linkcheck/validation/LinkValidatorManager.java#L337] is a little tricky to found :
> * # : All links page are excluded
> * ^#$ : Not found ... Java pattern seems not really used
> * *# : Do the trick finally
> Snippet for proof:
> {code}
>         String pattern = "#";
>         System.out.println(matchPattern("#", pattern)); // --> true
>         System.out.println(matchPattern("#localLink", pattern)); // --> true
>         System.out.println(matchPattern("http://fake.url.org/index.html#", pattern)); // --> true
>         System.out.println(matchPattern("http://fake.url.org/index.html#link", pattern)); // --> true
>         pattern = "^#$";
>         System.out.println(matchPattern("#", pattern)); // --> false
>         System.out.println(matchPattern("#localLink", pattern)); // --> false
>         System.out.println(matchPattern("http://fake.url.org/index.html#", pattern)); // --> false
>         System.out.println(matchPattern("http://fake.url.org/index.html#link", pattern)); // --> false
>         pattern = "*#";
>         System.out.println(matchPattern("#", pattern)); // --> true
>         System.out.println(matchPattern("#localLink", pattern)); // --> false
>         System.out.println(matchPattern("http://fake.url.org/index.html#", pattern)); // --> false ... corner case ?
>         System.out.println(matchPattern("http://fake.url.org/index.html#link", pattern)); // --> false
> {code}
> ----
> Perhaps consider a single anchor (#) as valid link by default could be useful and avoiding some headlock.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)