Problem with tidy.

For technical support for all editions of CSE HTML Validator. Includes bug reports.

Problem with tidy.

Postby RSteinwand » Thu May 26, 2011 2:02 pm

Hi Albert,

I was validating a blog post today... The source is from Outlook or Word and the slant single and double quotes had to be touched up.

Like usual, I'd see an invalid character show up in the message below and when I double-clicked it, the cursor would be many characters to the right of the actual character I need to fix and I have to search for it. I've grown accustomed to this problem.

Today, on a whim, I deleted the indent (4 tabs) on the line with the error and re-validated the page, and when I double clicked on the error message in the message box, the cursor was right in front of the error, right where I would expect it to be.

Is this something you're able to reproduce?

How about fix? :D
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 199
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND

Re: Problem with tidy.

Postby Albert Wiersch » Thu May 26, 2011 2:34 pm

Hi Rick,

Can you send me a sample document and details on exactly what you are doing to encounter this issue?

Thanks.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Problem with tidy.

Postby Albert Wiersch » Thu May 26, 2011 3:34 pm

Thanks Rick. I received your email.

I think you found the "key" to this problem with the tabs.

HTML Tidy is counting tab characters as more than 1 (I suspect that it is probably using the default of 8), and this is throwing off the character location.

You can workaround this by setting the tab-size to 1. This may affect "pretty printing", though, if you use that function.

For example, I editing my HTML Tidy profiles file and added this profile:
Code: Select all
    <profile name="Tab Correction" args="--tab-size 1" hint="Use tab-size 1 to correct character locations."/>


You can easily pull up the HTML Tidy profiles file with Options->Validator Engine Options->Edit Configuration FIles->HTML Tidy Profiles.

I then reloaded the profiles in the HTML Tidy page in the Validator Engine Options and selected that profile. Then, when I checked with HTML Tidy, the location was correct.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Problem with tidy.

Postby RSteinwand » Thu May 26, 2011 3:47 pm

Works now... Thanks.

Wish I had mentioned this years ago. :D
Rick
User avatar
RSteinwand
Rank IV - Intermediate
Rank IV - Intermediate
 
Posts: 199
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND


Return to CSE Tech Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests