Uploaded image for project: 'Maven Doxia Tools'
  1. Maven Doxia Tools
  2. DOXIATOOLS-59

Link checker not handling anchors of fluido skin topbar very well

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • doxia-linkcheck-1.2
    • None
    • Doxia Linkcheck

    Description

      When you are using maven-fluido-skin with topbar, category menus are produced with a single anchor (#) like that:

      <a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
      

      In this case, maven-linkcheck-plugin fails. You can simply reproduce the problem with this site.xml:

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

      You can use excludedLink property, but the pattern to use in
      LinkValidatorManager.matchPattern 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:

              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
      

      Perhaps consider a single anchor (#) as valid link by default could be useful and avoiding some headlock.

      Attachments

        1. bugfix.zip
          342 kB
          Chris Neve

        Activity

          People

            Unassigned Unassigned
            axel3rd Alix Lourme
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: