Skip to content

Newlines insert in script elements; vertical-space option ignored #227

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
nokome opened this issue Jul 12, 2015 · 5 comments
Closed

Newlines insert in script elements; vertical-space option ignored #227

nokome opened this issue Jul 12, 2015 · 5 comments

Comments

@nokome
Copy link
Contributor

nokome commented Jul 12, 2015

tidy 5.0.0RC1 seems to always insert a newline at the start and end of script (and pre) elements. From a code aesthetics point of view, this is undesirable for situations where the script is an inline element (in my case a MathJax element). Potentially related is the fact that the vertical-space option seems to have no effect. I am compiling against tidylib but the below illustrates the issue.

tidy --vertical-space no --indent no --wrap 0 --tidy-mark no html-test-doc.html

Input:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <p>
      Some old equation <script type="math/asciimath">E=mc^2</script>.
    </p>
  </body>
</html>

Expected output:

<!DOCTYPE html><html><head><meta charset="utf-8"><title></title></head><body><p>Some old equation <script type="math/asciimath">E=mc^2</script>.</p></body></html>

Actual output:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<p>Some old equation 
<script type="math/asciimath">
E=mc^2
</script>.</p>
</body>
</html>
@nokome
Copy link
Contributor Author

nokome commented Jul 12, 2015

So, I did some more trawling around through the issues and see that this is probably a duplicate of both #158 and #163 (and my misunderstanding of what vertical-space is intended for). Sorry for adding more clamour.

@geoffmcl
Copy link
Contributor

@nokome thank you for testing 5.0.0RC1... that is important...

yes, newlines inserted in <pre> tags #158 (feature and pretty print) is an old, OLD problem, still to be resolved... thankfully it is NOT a problem in some browsers, but others do make a new line in the display which should not be there! A big horror of tidy...

And Add option to prevent outputting unnecessary vertical whitespace #163 (feature and pretty print) is a clear request that --vertical-space f mean almost NO vertical space ;=)) Sort of like a compact html stream - just one line - maybe an interesting feature addition someone could be interested in coding...

Both requests are marked indefinite future, which means we are still looking for the C coder to take interest, give their time, and work on these two great features...

Are you the one? ;=))

Anyway, again, tar muchly for testing 5.0.0RC1... and reporting...

@nokome
Copy link
Contributor Author

nokome commented Jul 13, 2015

@geoffmcl I'll try to have another look at the code to see if I've got any chances of doing something constructive. If not, I would consider offering a bounty for one or both of these issues on Bountysource - would that be acceptable to HTACG?

@geoffmcl
Copy link
Contributor

@nokome had a look at Bountysource - looks quite interesting... a good way to motivate a programmer ;=))

From my quick reading around their site I can not see any problem with accepting such code if it is released under the same, or a compatible license, as Tidy, as written in the header tidy.h...

But I am no expert in these matters...

@geoffmcl
Copy link
Contributor

geoffmcl commented Sep 7, 2015

@nokome as covered in #228, #231, and others, think we can close this now...

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

2 participants