Skip to content

do not remove leading comment (body only) #803

@haraldschilly

Description

@haraldschilly

I want tidy to keep a leading comment (documentation and licensing info) when formatting a partial html file. A minimal example is

<!-- foo -->

<div>bar</div>

but after running tidy -modify --show-body-only auto --indent yes test.html

<div>
bar
</div>

there is no comment. The equivalent for a "full document" keeps the comment. I ran this with tidy version 5.2.0 and also built from scratch a version 5.7.22 myself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions