-
Notifications
You must be signed in to change notification settings - Fork 435
Closed
Description
I may be missing something somewhere but I was not expecting this Python code:
from tidylib import tidy_document
tidyoptions={
'tidy-mark': True,
'drop-empty-elements': False
}
document, errors = tidy_document('''<!DOCTYPE html><head><title>Test case</title></head><body><a href="/index.html">Text before a space</a><a href="/index.html"> text after a space</a></body></html>''',
options=tidyoptions)
print document
print errors
to give this result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for HTML5 for Linux version 4.9.26" />
<title>
Test case
</title>
</head>
<body>
<a href="/index.html">Text before a space</a><a href="/index.html">text after a space</a>
</body>
</html>
I was expecting the space within the second tag, at the beginning, to be retained.
The original html renders as "Text before a space text after a space". The tidied html renders as "Text before a spacetext after a space".