Topic: Tidy -1
Hi,
I have an issue with tidy set to -1
Example:
Sometimes a <em>user </em>will do this.
Expected:
Sometimes a user will do this.
Actual:
Sometimes a userwill do this.
Thank you for your consideration.
You are not logged in. Please login or register.
PHP Labware forum → htmLawed → Tidy -1
Hi,
I have an issue with tidy set to -1
Example:
Sometimes a <em>user </em>will do this.
Expected:
Sometimes a user will do this.
Actual:
Sometimes a userwill do this.
Thank you for your consideration.
This is expected with the implementation for tidy = -1. From the htmLawed documentation: "To compact, use $config["tidy"] = -1; single instances or runs of white-spaces are replaced with a single space, and white-spaces trailing and leading open and closing tags, respectively, are removed."
Are you suggesting that this be changed, that white-spaces trailing and leading open and closing tags, respectively, should not be removed?
Yes. I am suggesting it be changed.
From the same documentation:
"Browser applications are supposed to consider contiguous white-spaces as just a single space, and to disregard white-spaces trailing opening tags or preceding closing tags."
Run the code in *any* browser.
Expected result occurs. Thusly, I expect HTMLawed mimics browsers.
I know technically, and to spec, you are correct.
But A/B comparison is another story.
Thank you for your consideration.
You have made a good point.
I have now modified htmLawed's 'tidying' functionality to obtain the behavior that you suggest, and for a couple of other minor fixes to the functionality. These modifications are in the new 1.1.15 version. You can test the new version on the htmLawed demo page, here.
Hey, thanks!
I was away on vacation. Sorry for the delayed response. I am looking at this today. I noticed the htmLawed_TESTCASE.txt diffs as follows:
- <rt>さい</rt>
- <rt>とう</rt>
- <rt>のぶ</rt>
- <rt>お</rt>
+ <rt>„Åï„ÅÑ</rt>
+ <rt>とう</rt>
+ <rt>のぶ</rt>
+ <rt>„Åä</rt>
(Happens in a few places in that file, Russian for example) Not a show stopper but thought you might like to know.
Best regards,
Thanks for noticing this. Yes, seems like I had a text editor issue with the UTF-8 encoding of the text while changing this file. I will replace the file once I am back from my short break.
I will replace the file once I am back from my short break.
The test-cases file in the htmLawed zip download file has now been replaced with a correctly encoded one.
PHP Labware forum → htmLawed → Tidy -1