Menu

#101 Extra new lines when cleaning

v2.30
open-accepted
nobody
None
5
2023-06-19
2013-12-05
No

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

Input:

@Test
    public void cleanTitleWithNamespace() throws Exception
    {
        // 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 extra new lines as shown on https://www.evernote.com/shard/s119/sh/7876478a-42d2-421d-9780-b53ea7c88660/9a60e113784cc72a16f560ef2d5a0f84

Discussion

  • Scott Wilson

    Scott Wilson - 2013-12-06
    • status: open --> open-accepted
    • Group: v 2.7 --> v 2.8
     
  • Scott Wilson

    Scott Wilson - 2013-12-06

    Moving to fix in 2.8

     
  • Scott Wilson

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

    Scott Wilson - 2014-04-07

    Rather than whitespace being added, its being moved from between the html, head and body tags and placed within them instead.

     
  • Scott Wilson

    Scott Wilson - 2014-08-13
    • Group: v 2.9 --> v 2.10
     
  • Scott Wilson

    Scott Wilson - 2014-10-31
    • Group: v 2.10 --> v 2.11
     
  • Scott Wilson

    Scott Wilson - 2015-05-12
    • Group: v 2.11 --> v2.12
     
  • Scott Wilson

    Scott Wilson - 2015-05-15
    • Group: v2.12 --> v2.13
     
  • Scott Wilson

    Scott Wilson - 2015-07-01
    • Group: v2.13 --> v2.14
     
  • Scott Wilson

    Scott Wilson - 2015-08-24
    • Group: v2.14 --> v2.15
     
  • Scott Wilson

    Scott Wilson - 2015-10-01
    • Group: v2.15 --> v2.16
     
  • Scott Wilson

    Scott Wilson - 2015-11-20
    • Group: v2.16 --> v2.17
     
  • Scott Wilson

    Scott Wilson - 2016-10-19
    • Group: v2.17 --> v2.18
     
  • Scott Wilson

    Scott Wilson - 2017-02-06
    • Group: v2.18 --> v2.19
     
  • Scott Wilson

    Scott Wilson - 2017-02-07
    • Group: v2.19 --> v2.20
     
  • Scott Wilson

    Scott Wilson - 2017-05-02
    • Group: v2.20 --> v2.21
     
  • Scott Wilson

    Scott Wilson - 2017-05-11
    • Group: v2.21 --> v2.22
     
  • Scott Wilson

    Scott Wilson - 2018-04-24
    • Group: v2.22 --> v2.23
     
  • Scott Wilson

    Scott Wilson - 2019-09-04
    • Group: v2.23 --> v2.24
     
  • Scott Wilson

    Scott Wilson - 2020-04-29
    • Group: v2.24 --> v2.25
     
  • Simon Urli

    Simon Urli - 2020-04-30

    Hi, any news about this bug? I can see we still have an ignored test in our code base related to it :)

     
  • Scott Wilson

    Scott Wilson - 2021-09-24
    • Group: v2.25 --> v2.26
     
  • Scott Wilson

    Scott Wilson - 2023-04-29
    • Group: v2.26 --> v2.29
     
  • Scott Wilson

    Scott Wilson - 2023-06-19
    • Group: v2.29 --> v2.30
     

Log in to post a comment.