This enables scour to consistently perform other optimizations that
rely on string equality to determine if two attributes are identical.
Signed-off-by: Niels Thykier <niels@thykier.net>
Improve the code for rewriting colors into recognising that some
colors are shorter by name. This commit enables scour to rewrite
`rgb(255, 0, 0)` into `red` which is slightly shorter than `#f00`
(ditto for `tan` and `pink`).
When the color name ties in length with the hexcode, then scour will
leave it as-is if the input file used a variant of same length
(e.g. `blue`, `cyan` and `aqua` will be left as-is). But if scour is
rewriting the color code, it will prefer the hex code variant.
Signed-off-by: Niels Thykier <niels@thykier.net>
Preserve prefix of attribute names when copying them over to the new
node. This fixes an unintentional rewrite of `xml:space` to `space`
that also caused scour to strip whitespace that should have been
preserved.
Closes: #239
Signed-off-by: Niels Thykier <niels@thykier.net>
This rename makes py.test/py.test-3 find the test suite out of the
box. Example command lines:
# Running the test suite (optionally include "-v")
$ py.test-3
# Running the test suite with coverage enabled (and branch
# coverage).
$ py.test-3 --cov=scour --cov-report=html --cov-branch
Signed-off-by: Niels Thykier <niels@thykier.net>