Skip to content

Add option to prevent outputting unnecessary vertical whitespace #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjbshaw opened this issue Feb 17, 2015 · 1 comment
Closed

Add option to prevent outputting unnecessary vertical whitespace #163

mjbshaw opened this issue Feb 17, 2015 · 1 comment

Comments

@mjbshaw
Copy link

mjbshaw commented Feb 17, 2015

Input:

<html>
<head>
<meta>
<meta>
<title>
TITLE
</title>
</head>
</html>

Output of ./tidy5 -access 1 --vertical-space f -wrap 0:

<!DOCTYPE html>
<html>
<head>
<meta>
<meta>
<title>TITLE</title>
</head>
<body>
</body>
</html>

This is a feature request to add an option to tell Tidy to not add newlines that aren't necessary. So the output would be more like the following:

<!DOCTYPE html>
<html><head><meta><meta><title>TITLE</title></head><body></body></html>

Right now, Tidy adds newlines that aren't actually needed. Ideally, an option would exist to make Tidy only add a newline if it was actually necessary (to preserve the original meaning of the document, or to fix existing issues in a document).

@mjbshaw mjbshaw changed the title Add option to Add option to prevent outputting unnecessary vertical whitespace Feb 17, 2015
@balthisar balthisar added this to the Indefinite future milestone Feb 23, 2015
@geoffmcl geoffmcl modified the milestones: 5.1, Indefinite future Jul 13, 2015
@geoffmcl
Copy link
Contributor

geoffmcl commented Sep 6, 2015

@mjbshaw you should pull and built the latest master branch, version 5.1.8 (2015.09.04) onward...

As can be seen in Issue #231 Tidy has a New Feature --vertical-space auto ;=))

Using your above Input and a config file of -

// New Feature - *NO* vertical space
vertical-space: auto
wrap: 0
show-info: no
tidy-mark: no
// not sure why you added this (as -access 1)
// accessibility-check: 1

Gets a simple single one-line html output of -

<!DOCTYPE html><html><head><meta><meta><title>TITLE</title></head><body></body></html>

which is more or less what you suggested... so am closing this issue...

Please feel free to re-open, or open a new issue...

For backward config capability --vertical-space yes and the default --vertical-space no will continue to produce what you may think of as additional unneccessary vertical space, but I guess it is much loved by many people...

Setting a yes, the so called tidy classic mode, will even add some more vertical space in specific certain circumstances...

Anyway, now you have an option for no vertical space ;=))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants