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

Tidy just intent first level, not nested levels #916

Open
dehghani-mehdi opened this issue Dec 25, 2020 · 5 comments
Open

Tidy just intent first level, not nested levels #916

dehghani-mehdi opened this issue Dec 25, 2020 · 5 comments

Comments

@dehghani-mehdi
Copy link

dehghani-mehdi commented Dec 25, 2020

I'm using latest version, imagine following html:

<main><header>header</header></main>

With this options:

indent: auto
indent-with-tabs: yes
keep-tabs: yes
wrap: 0
merge-divs: no
merge-spans: no

Expected result would be:

<main>
    <header>
        header
    </header>
</main>

But Tidy generates this:

<main>
<header>
header
</header>
</main>

I could not find any related option, is there any way to tell Tidy to intent nested levels too?

@ler762
Copy link
Contributor

ler762 commented Dec 25, 2020 via email

@geoffmcl
Copy link
Contributor

@dehghani-mehdi, thank you for the issue, and @ler762, thank you for doing some further testing...

There certainly seems something WRONG with indenting with tabs!

With --indent-with-tabs yes, the output looks really BAD! -

	<div>
	<main>
	<h1>header</h1>
	</main>
	</div>

I would at least expect something like -

	<div>
		<main>
			<h1>header</h1>
		</main>
	</div>

To more or less match the default space -i output -

  <div>
    <main>
      <h1>header</h1>
    </main>
  </div>

Looking back to when I first implemented the indent-with-tabs option, Nov 2013, issue #108, and a subsequent fix by @balthisar, Nov 2015, merge #290, and #335, maybe #403, and maybe others, I see they also discuss some problems with tabs...

Look forward to further discussion, code, PR, ... to address this Pretty Print issue... thanks...

@Feathered-Serpent
Copy link

Is there a new quick reference somewhere? because indent-with-tabs isn't listed on http://tidy.sourceforge.net/docs/quickref.html

@geoffmcl
Copy link
Contributor

geoffmcl commented Apr 7, 2021

@Feathered-Serpent thanks for the question... but...

OT: BTW, over the years I have noted some old web sites that still have this SF legacy site link, so have now added a note at the top of the page - refresh it in a browser - which should be self explanatory...

But even the latest quickref.html online is already back at version 5.7.0, while next is 5.7.45... years later... and maybe other changes...

You can generate new next API docs by cloning html-tidy.org.api - there is a build_docs.sh and build-me.bat, in the tidy-html5-doxygen folder - you need xsltproc, doxygen, ... apps in PATH...

Hope this answers your question...

PS: @Feathered-Serpent, it is not a good idea to put such OT questions, on any existing issue... but no problem...

@balthisar balthisar added this to the 5.9 milestone Jul 9, 2021
@tenzap
Copy link

tenzap commented Dec 1, 2021

Problem is also in 5.6.0

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

6 participants