DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Reply
 
Thread Tools Display Modes
Old 02-03-2007, 05:51 AM   #1
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default Tidy Help

Anyone here use Tidy? I want to know if there's a setting that will prevent it from converting a numeric entity into a character? For example, it seems to convert "m" to "m" and so forth. The -n switch converts named entities into numeric entities, but with this option Tidy still converts simple numeric entities to their characters, I guess if they're printable characters under ascii 128. I've been looking through the docs, and while there are lots of configuration options, I can't seem to find what I'm looking for.
CarlSeiler is offline   Reply With Quote
Old 02-17-2007, 06:09 AM   #2
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

Quote:
Originally Posted by CarlSeiler View Post
For example, it seems to convert "m" to "m" and so forth.
Oops. Just to clarify here, that should read 'seems to convert "&_#109;" to "m" and so forth.' My characters got stripped--I can't seem to figure out how to escape this in the forum software. That is, Tidy converts the ampersand#109semicolon group into an m.
CarlSeiler is offline   Reply With Quote
Old 02-18-2007, 05:29 AM   #3
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Well, I don't know if Tidy has such a setting - but why would you want to use numeric entities for normal, pure ASCII characters? Just curious...

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 02-18-2007, 11:05 AM   #4
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

Quote:
Originally Posted by iamback View Post
why would you want to use numeric entities for normal, pure ASCII characters? Just curious...

Because of post #7 in this thread. I had done a mixture of different characters only to find that they'd all been converted back into plaintext somewhere along the way. I found out the culprit is Tidy.
CarlSeiler is offline   Reply With Quote
Old 02-19-2007, 04:48 AM   #5
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

I posted my question to the Tidy mailing list at w3c (under my usual alias) and got a response.
http://lists.w3.org/Archives/Public/...nMar/0040.html

The answer is no, you can't do it, and the guy even guessed at why I wanted to, and suggested a post-processing script. Which might be a good idea if I had some idea of how to accomplish that. :-S I'm assuming you'd do it with Awk or Perl.

carl
CarlSeiler is offline   Reply With Quote
Old 02-19-2007, 05:50 AM   #6
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by CarlSeiler View Post
The answer is no, you can't do it, and the guy even guessed at why I wanted to, and suggested a post-processing script. Which might be a good idea if I had some idea of how to accomplish that. :-S I'm assuming you'd do it with Awk or Perl.
What about doing your encoding after all the editing with Tidy is done? Or would that be too time-consuming?

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 02-19-2007, 09:01 AM   #7
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

Quote:
Originally Posted by ktinkel View Post
What about doing your encoding after all the editing with Tidy is done? Or would that be too time-consuming?
Doing it by hand would be a bit too time-consuming. Set it and forget it would be best. That's why I wish Tidy didn't mess things up or at least I could automate things with awk if I could figure out a way.
CarlSeiler is offline   Reply With Quote
Old 02-24-2007, 06:20 AM   #8
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

OK, after posting my question to the HTML Tidy list mentioned above, I have replies off-list. One of them was from a Tidy developer who pointed out at in the 2007-02-11 version of the Tidy source there's an option called "--preserve-entities" which does exactly what I need.

Problem was, there wasn't any recent Windows binary that was available for download from the Sourceforge site. So, what I did was get Cygwin and compile under Cygwin. The Cygwin executable works under regular Windows after I move cygwin1.dll where Windows can see it. Of course, after I compiled it myself, the developer pointed out a Windows binary of HTML Tidy available at Dirk Paehl's web site.

I'm currently using my Cygwin compiled version and it seems to do just what I need.
Carl
CarlSeiler is offline   Reply With Quote
Old 02-24-2007, 11:45 AM   #9
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by CarlSeiler View Post
I'm currently using my Cygwin compiled version and it seems to do just what I need.
That's great, congratulations.

Only after posting my question did I realize what might be the reason; and for preserving obfuscation of course it's reasonable to be able to specify that to Tidy. Just strange that it's a compile-time option rather than a run-time option since most of the time you'd want to have it do exactly what it does by default: converting entities for printable ASCII (at least) into their corresponding characters. It sounds to me like if there is a compile-time option now it should not be too hard for a programmer to turn that into a run-time option.

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 02-24-2007, 01:44 PM   #10
CarlSeiler
Member
 
CarlSeiler's Avatar
 
Join Date: Oct 2005
Location: Denton, TX
Posts: 271
Default

Quote:
Originally Posted by iamback View Post
Just strange that it's a compile-time option rather than a run-time option since most of the time you'd want to have it do exactly what it does by default: converting entities for printable ASCII (at least) into their corresponding characters. It sounds to me like if there is a compile-time option now it should not be too hard for a programmer to turn that into a run-time option.
Just to clarify here: It is a run-time option. The reason I needed to compile it was that the option is new and not in the older binary versions for Windows that are available for download as listed on the Sourceforge site. I needed to compile my own just to get the current version. This run-time option has only been available since 2007-02-11. In the meantime, someone pointed out the more up-to-date Windows binary available on Dirk Paehl's site, making the compilation even less necessary.
CarlSeiler is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tidy dacoyle Web Site Building & Maintenance 9 11-25-2006 03:06 PM
TIDY for CSS? dthomsen8 Web Site Building & Maintenance 27 03-27-2006 09:54 AM


All times are GMT -8. The time now is 10:50 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.