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

Need help controlling output #894

Closed
designosis opened this issue Sep 15, 2020 · 2 comments
Closed

Need help controlling output #894

designosis opened this issue Sep 15, 2020 · 2 comments

Comments

@designosis
Copy link

For a while, running tidy -i -m -q -w 0 -ashtml -utf8 filename.html was outputting exactly how I wanted.

<!DOCTYPE html>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <div class="row">
            <div class="col1">Column 1</div>
            <div class="col2">Column 2</div>
        </div>
    </body>
</html>

Wanting to improve my workflow, I added the following to my ~/.tidyrc:

indent: yes
indent-spaces: 4
tidy-mark: no
wrap: 0
quiet: yes

However tidy began adding newlines after <div class="url"> and any content in the <div>.

            <div class="col1">
                Column 1
            </div>

Now, no matter what I try (even removing .tidyrc) I can't seem to get that functionality back. Did I hallucinate that it did this before? I really prefer content within tags to remain on the same line.

What combination of .tidyrc parameters and command-line flags allows this to happen?

@geoffmcl
Copy link
Contributor

@neokio I am not sure what version of tidy you are running, but maybe it does not matter...

For a while, running tidy -i ... was outputting exactly how I wanted.

HUH! I do not think that is possible... the sample shown can NOT be from tidy...

Tidy has NEVER not added newlines for each div/text tag... if indent is ON in the config...

In other words, Tidy has ALWAYS made a div with text into 3 lines, if -i is specified... back to the first tidy release, Aug, 2000...

Without indent specified, simple wrap width will come into play...

So, yes, you did hallucinate that it did this before? ;=))

Look forward to further feedback, or perhaps this issue closed... thanks...

@designosis
Copy link
Author

Thanks for the response! And for diagnosing my schizophrenia :)
I must have omitted the -i flag, seen output I wanted, then re-added it while trying to be clever with other stuff. Pity there's no way to indent tags without splitting out content onto a new line!

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