Skip to content

Feature request: "preserve" value for anchor-as-name #733

Open
@ghost

Description

Thanks for maintaining HTML Tidy!

The documentation for --anchor-as-name says:

Type: Boolean ...
If set to yes a name attribute, if not already existing, is added along an existing id attribute if the DTD allows it.
If set to no any existing name attribute is removed if an id attribute exists or has been added.

I can see that those two distinct functionalities may each be useful in specific use cases. It is good that tidy offers them.

However, if the user wishes for no modifications to be made to existing name or id attributes, then they would seem to be out of luck: tidy simply does not seem to offer this.

Therefore, I ask that --anchor-as-name be changed from taking a Boolean argument to taking either an Autobool argument or an enum argument, to allow the user to choose from at least three values to pass as an argument: each of the two existing values (e.g. "yes", and "no"), and a new, no-op value (e.g. "auto", or "preserve").

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions