Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6377

Autolinking breaks hierarchy for nested elements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.6.0, 8.0.0-M6
    • 7.8.0, 8.0.0-M7
    • None
    • None

    Description

      The problem appears with the following HTML-code:

      <a href="#top">
          <span wicket:id="top"></span>
      </a>
      

      with autolinking set to true like this:
      getMarkupSettings().setAutomaticLinking(true)

      This leads to the following exception:
      org.apache.wicket.markup.MarkupException: Unable to find component with id 'top' in [WebMarkupContainer [Component id = _autolink_-335431082]] Expected: 'autolink-335431082:top'.

      This happens since the the fix of WICKET-6289. The bugfix in this issue was to create a WebMarkupContainer as default autocomponent. It was and ExternalLink before, which didn't cause any trouble in this case.
      But is it really correct that AutoLinkResolver even tries to replace an anchor link?

      I also created a quickstart project to reproduce the problem:
      https://github.com/sunshineKE/test.autolinking

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Claudia Hirt Claudia Hirt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: