Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-1250

parse-html does not parse links with empty anchor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • parser
    • None
    • Patch Available

    Description

      The parse-html plugin does not generate an outlink if the link has no anchor
      For example the following HTML-Code does not create an Outlink:

       
        <a href="example.com"></a>
      

      The JUnit-Test TestDOMContentUtils tries to test this but fails since there is a comment inside the <a>-Tag.

      TestDOMContentUtils.java
      new String("<html><head><title> title </title>"
              + "</head><body>"
              + "<a href=\"g\"><!--no anchor--></a>"
              + "<a href=\"g1\"> <!--whitespace-->  </a>"
              + "<a href=\"g2\">  <img src=test.gif alt='bla bla'> </a>"
              + "</body></html>"), 
      

      When you remove the comment the test fails.

      TestDOMContentUtils.java Test fails
      new String("<html><head><title> title </title>"
              + "</head><body>"
              + "<a href=\"g\"></a>" // no anchor
              + "<a href=\"g1\"> <!--whitespace-->  </a>"
              + "<a href=\"g2\">  <img src=test.gif alt='bla bla'> </a>"
              + "</body></html>"), 
      

      Attachments

        1. DOMContentUtils_v1.patch
          0.8 kB
          lufeng
        2. DOMContentUtils_v2.patch
          1 kB
          lufeng
        3. TestDomContentUitls_v1.patch
          1 kB
          lufeng

        Activity

          People

            Unassigned Unassigned
            theo Andreas Janning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: