html5lib / gcode-import

Automatically exported from code.google.com/p/html5lib. Purely archival.
Other
7 stars 8 forks source link

Only first instance of white space is stripped #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When serializing HTML with the the strip_whitespace option on only the
first instance of whitespace in any Character token is stripped

You can see this if you running a whitespace unit test with the following data

{"description": "bare text with multiple groups of inner spaces",
 "options": {"strip_whitespace": true},
 "input": [["Characters", "foo \t\r\n\u000B\u000C bar and more \t\r\n bar"]],
 "expected": ["foo bar and more bar"]
}

which results in the failure

  1) Failure:
test_whitespace_4(Html5SerializeTestcase) [test/test_serializer.rb:48]:
bare text with multiple groups of inner spaces.
<"foo bar and more bar"> expected but was
<"foo bar and more \t\r\n bar">.

A patch is attached to fix this.

Original issue reported on code.google.com by joel.chippindale@gmail.com on 30 Jul 2008 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ryansk...@gmail.com on 30 Jul 2008 at 8:25

GoogleCodeExporter commented 9 years ago

Original comment by ryansk...@gmail.com on 30 Jul 2008 at 8:25