-
Notifications
You must be signed in to change notification settings - Fork 410
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
Feature request: "preserve" value for anchor-as-name #733
Comments
@sampablokuper thanks for the issue, I think... Now maybe this is a good Then you would need to show what you expect from That is move this from theory, based on current documentations, which may or may not be the whole story, to simple practical examples... tidy currently does this... with config I have tried to read and understand the current In essence the samples only need to be one line, and we can use At this time marking this as |
@geoffmcl, thanks for your reply. With the input
By contrast, with the input
Therefore, neither of those two options can be relied upon, in the general case, as a no-op. The proposed
I hope this demonstrates the validity of the feature request, and that this is not a technical support query. Thanks again :-) |
@sampablokuper thanks for the Sort of OT, but you are another person to comment on Accordingly will try changing this to a clearer, simple idea of a Am doing some testing on your samples, especially Also searching and reading W3C docs on this, and running tests on the W3C validator, both One of the important considerations is that any type of Tidy's general aim should be to produce a valid W3C document. I know this is not always the case at present, but it tries, and can be improved... Such an option should not force tidy to produce invalid html... Not that anything you have suggested so far is an error, but I hope you get the idea... At present this seems all in the This may take some time to put together a Seek further feedback, discussion, examples, even patches, or a PR, etc... would be most appreciated... thanks... |
Thanks for your follow-up :-)
Good call.
In the case of an (X)HTML or XML fragment or snippet, the input to Tidy is necessarily not a valid document. Nevertheless, it is reasonable for a user to want Tidy to process that input. To satisfy this reasonable use case, Tidy must necessarily be capable of creating output other than valid documents. Fortunately, Tidy is already capable of this, as you know :-) Personally, I think it is most useful to think of Tidy's end goal to be to act as a set of filters, each of which is designed to correct or to report on some category of issues likely to be found in (X)HTML or XML documents or fragments. Ideally, the user should be able to selectively turn those filters on or off. (And if on, then to choose between various available applications of those filters, if appropriate - e.g. to choose between The power to create valid documents must be part of that. But the power to prevent Tidy from silently semantically altering the input should also be available.
I'm sorry that I can't offer anything further in that vein right now :-( |
@sampablokuper looked more at this, but still blocked on what is the purpose of this In the main will leave aside the philosophic discussion on what is, or should be, tidy's goal, but stick with help produce valid html for the user... I am sure we could just go back and forth on this forever... will try to concentrate on any pratical use, and need, of this feature request... I agree the current documentation is not sufficient, nor very helpful... That certainly needs to be improved... suggestions very welcome... Next it seems this option means slightly different things in html5 vs legacy html4 documents... HTML4In html4 W3C specs, like links html4, you can find things like Hence, I think, this option came about to ensure if the user had added an So here you need to show a use case where Either you let tidy fix the document, adding Where then is HTML5Then html5 was born, and this sort of flipped this option on it head! The But Thankfully if only So while this indicates some work needed for html5, and some document updates, I can not see the usefulness of adding a If you disagree, what should it do in this html5 case? Again html5 document samples please... TestingNow, to begin testing and understanding this, I have add 7 test files to my site, and could add more -
These files can be viewed as html, by adding I am really trying to find a valid use case for this Hope you, or others, can assist... thanks... |
@geoffmcl wrote:
Already provided in my comment above.
If an application consuming the HTML applies different semantics to Similarly, removing a So, there needs to be an option besides
Again, already provided in my comment above. |
@geoffmcl wrote:
I do disagree. IMO a FYI, in HTML5, AFAICT, it is perfectly valid for such elements to have both the
This is not quite correct.
These would be exactly the same as in my comment above, except that instead of the |
@sampablokuper what Ok, at least you are starting to narrow it down, and that is for HTML4... And have you tested XHTML? Give an example where While I have no problem reading This issue is about an And just to be clear, adding a So really no new information added... and I am not yet convinced that such a Now all that means is that I am not personally interested in coding such a change... so left to me this would presently be a If you, or others, want to present a PR, or further feedback, I will try to listen for a stronger use case... thanks... |
@geoffmcl wrote:
No specific one: could be a simple static website, could be a dynamic web application. Could even be a mobile app with a WebView, or whatever.
Not just for HTML4. I have addressed XHTML and HTML5 as well, in my comments above.
I already gave a relevant example of Tidy's behaviour in my comment above. Quoting the man page: "If set to strict, Tidy will set the DOCTYPE to the HTML4 or XHTML1 strict DTD."
I did not say Tidy is "in error". I explicitly marked this issue as a feature request. In doing so, I noted a reasonable use case that Tidy currently fails to handle, that it would handle if the requested feature were added.
That is incorrect. This issue is a feature request relating to Tidy's
See above.
As I mentioned in my first post above, the use of an Autobool as a way to provide a third option seems OK to me.
I think you are, in this case.
The use case is already strong. If, despite that, you don't want to address the issue, then that will just perpetuate an inconvenience for Tidy's users :-( In any case, rather than closing this issue as WontFix, I would ask that it at least be left open for anyone who does have an interest in submitting a fix and closing via PR to do so. Thanks. |
Thanks for maintaining HTML Tidy!
The documentation for
--anchor-as-name
says: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
orid
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").The text was updated successfully, but these errors were encountered: