Menu

#103 Attributes of HTML element are stripped under some circumstances

v 2.9
closed-fixed
None
5
2015-02-16
2013-12-06
No

Input:

        // Test with TITLE in HEAD
        String input = "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n"
            + "  <head>\n"
            + "    <title>Title test</title>\n"
            + "  </head>\n"
            + "  <body>\n"
            + "    <p>before</p>\n"
            + "    <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"300\" width=\"500\">\n"
            + "      <g>\n"
            + "        <title>SVG Title Demo example</title>\n"
            + "        <rect height=\"50\" style=\"fill:none; stroke:blue; stroke-width:1px\" width=\"200\" x=\"10\" "
            + "y=\"10\"></rect>\n"
            + "      </g>\n"
            + "    </svg>\n"
            + "    <p>after</p>\n";
        Assert.assertEquals(HEADER + input + FOOTER, HTMLUtils.toString(this.cleaner.clean(new StringReader(input))));

Results in:
https://www.evernote.com/shard/s119/sh/7876478a-42d2-421d-9780-b53ea7c88660/9a60e113784cc72a16f560ef2d5a0f84

See also https://sourceforge.net/p/htmlcleaner/bugs/99/

Discussion

  • Scott Wilson

    Scott Wilson - 2013-12-09
    • Group: v 2.7 --> v 2.8
     
  • Scott Wilson

    Scott Wilson - 2014-03-18
    • Group: v 2.8 --> v 2.9
     
  • Scott Wilson

    Scott Wilson - 2014-08-13

    Fixed in 2.9; this related to recognising variations of the XHTML XMLNS, including incorrect ones.

     
  • Scott Wilson

    Scott Wilson - 2014-08-13
    • status: open --> closed-fixed
    • assigned_to: Scott Wilson
     
  • Vincent Massol

    Vincent Massol - 2014-08-13

    Thanks a lot Scott! :)

     

Log in to post a comment.