Skip to content

CLI option to stop insertion/deletion of tags #682

@codeniko

Description

@codeniko

Hi, I use Jekyll for templating and the Jekyll generated html files handle spacing/indentation in a terrible manner. I'd like to use tidy to clean up just the spacing/indentation and remove comments, but tidy seems to be packed with destructive defaults which alter the normal behavior of pages. Scanning the man page several times, I've tried to remove as many as I could for my simple use case but I just can't find the option to stop tidy from inserting implicit tags and discarding enexpected tags.

Knowingly against spec, I happen to have a <div> element inside of a <label> that I use to trigger a checkbox to hide/show another div (a menu). Being that it's a menu used for navigation, I'd rather not use javascript to handle this in case a user happens to disable it.

I'm currently running tidy for Apple macOS version 5.7.3 with the following options
--merge-divs no --merge-spans no --enclose-block-text no --enclose-text no --coerce-endtags no --hide-comments yes --wrap 0 --tidy-mark no --drop-empty-elements no --drop-empty-paras no -indent

I'm still getting the following 3 warnings, the last two being the ones I wish to disable.

line 56 column 7 - Warning: missing </label> before <div>
line 57 column 39 - Warning: inserting implicit <label>
line 58 column 7 - Warning: discarding unexpected </label>

This behavior is weird as the output code contains two of the same exact labels with the same for attribute value: original label outside but no longer wrapped around the div, and a newly generated one inside the div. This ultimately breaks my pages.

Please let me know if there exists cli options to disable said insertion and deletion. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions