Skip to content
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

insertion of spurious linebreak before P end tag if paragraph contains only an anchor #742

Open
phloxic opened this issue Jun 6, 2018 · 4 comments
Milestone

Comments

@phloxic
Copy link

phloxic commented Jun 6, 2018

$ echo '<p>test <a href="/example/">expected</a></p>' | tidy -config /dev/null 2>/dev/null
<!DOCTYPE html>
<html>
<head>
  <title>
  </title>
</head>
<body>
  <p>test <a href="/example/">expected</a></p>
</body>
</html>
$ echo '<p><a href="/example/">unexpected</a></p>' | tidy -config /dev/null 2>/dev/null
<!DOCTYPE html>
<html>
<head>
  <title>
  </title>
</head>
<body>
  <p><a href="/example/">unexpected</a>
  </p>
</body>
</html>
~$ tidy -version
HTML Tidy for Apple macOS version 5.6.0
@geoffmcl
Copy link
Contributor

@blacktrash sorry for the delay, but was hoping someone else would pick this up...

The only way I can duplicate your unexpected output, is to add --vertical-space yes to the tidy configuration... tested with 5.6.0 release, through to next 5.7.16...

There must be some default configuration in play, otherwise there should be a <meta name="generator" content="<tidy-version>"> in both the expected, and unexpected outputs you have shown...

I do agree there is a strangeness about why that vertical-space: yes option only effects when the paragraph content is solely a anchor, a link... and not if mixed with other text content...

Just an extra note about the vertical-space option... original tidy, sometimes referred to as classic mode in the code, had lots, and lots of vertical space... too much for many... later developers sort to reduce these, hence the current default of vertical-space: no... and where vertical-space: auto became almost no vertical space at all - a sort of single line compressed html stream...

Anyway, appreciate patches, PR to make this consistent in each type of paragraph case... thanks...

@phloxic
Copy link
Author

phloxic commented Oct 27, 2018

@geoffmcl - thanks for getting back.
I do have vertical-space: yes set, but I would have expected -config /dev/null to override any tidyrc, according to the fine manual?

@ler762
Copy link
Contributor

ler762 commented Oct 28, 2018

@blacktrash if the fine manual says -config /dev/null overrides any tidyrc then it's wrong; see PR #754

@phloxic
Copy link
Author

phloxic commented Oct 28, 2018

@ler762 - thanks. Indeed with -config /dev/null I believed to have found an obvious way to report a potential bug/glitch which happens also in the default config scenario. I believed wrong ;-)
Other than that I think that vertical-space should not influence this particular scenario.

@balthisar balthisar added this to the 5.9 milestone Jul 9, 2021
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

4 participants