Skip to content

tidy change html view when deal with white-space:pre tag #685

@cztchoice

Description

@cztchoice

html before tidy

<html>
<head>
<title>Test document</title>
</head>
<body>
<div dir="ltr"><br><ol style=""><li dir="ltr" style="white-space:pre"><p dir="ltr" style=""><span style="white-space:pre-wrap">Since 2003 </span></p></li></div>
</body>
</html>

html look like:
image

after tidy

<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39">
<title>Test document</title>
</head>
<body>
<div dir="ltr"><br>

<ol style="">
<li dir="ltr" style="white-space:pre">
<p dir="ltr" style=""><span style="white-space:pre-wrap">Since 2003</span>
</p>
</li>
</ol>
</div>
</body>
</html>

rendered like:
image

tidy cfg:

indent: false
indent-attributes: false 
output-html: yes
input-xml: false
wrap: 0
vertical-space: yes

it looks like tidy doesn't handle white-space style well.

Do you have any work around for this to make html look like correctly?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions