Genii Weblog
Annoying HTML problem - any ideas?
Tue 17 Aug 2004, 11:18 PM
Tweetby Ben Langhinrichs
This is a so annoying, there has to be a fix. Normally, the formatting in an HTML file doesn't matter much, but in the following instance, it causes a problem. In Midas, when you export HTML in related files to a directory, the doclinks show up like:
<a href="FX90A.htm"><img src="doclink.gif" border="0"></a>
which works just fine, unless the formatting breaks the line as:
<a href="FX90A.htm">
<img src="doclink.gif" border="0"></a>
in which case, you get a single underlined space which is part of the link. Currently, the formatter doesn't much care about the content of tags, but it does try to keep tags together, so this is more likely than
<a href="FX90A.htm"><img
src="doclink.gif" border="0"></a>
which would actually work better in this case, but would be harder to read. I guess the question I have is whether there is the opposite of a non-blanking space ( ) or something that would absorb the empty space in case the formatter tried to put it in? Am I reaching for straws? Is there some better way to handle this?
Copyright © 2004 Genii Software Ltd.
What has been said:
196.1. David Bockes (08/18/2004 05:37 AM)
I've seen the same problem under completely different circumstances. I've got a mail agent that I use a java package to allow me to do html mail (developed pre R6). I have seen this exact problem in that. My html source won't have a line break in the link tag, but when the message source is viewed I would see one. The cheap fix was to monkey around with the length of the line that the link was on until the break happened outside of the link tag. I'd always figured this was an idiosyncrasy with the java package I was using. While similar, it probably is unrelated to the problem you're seeing. Using the native ability in 6 to do html mail I don't have this problem. Not much help, I know, I just wanted to commiserate.
196.2. Richard Schwartz (08/19/2004 12:14 AM)
Why do you break it there in the first place? If readability is the objective, I'd much rather see my a.../a tags always kept on one line, even if it makes that line really long. Have you looked into the possibility of using a full-featured HTML prettyprint tool? There's one here, available as C source code.
-rich
196.3. Hassan Voyeau (19/08/2004 08:13 AM)
You could always use javascript. I tested the code below and it seems to do the trick...
196.4. Hassan Voyeau (19/08/2004 08:16 AM)
OK. Your comments ate my code. Here it is again
onLoad="javascript : for (var i= document.links.length; i-->0;){ document.links[i].innerHTML = document.links[i].innerHTML;}"
196.5. Ben Langhinrichs (08/19/2004 08:44 AM)
The comments logic will probably keep eating the code. Could you send to me at Ben@GeniiSoft.com and I'll format them in such a way that they show up? Thanks in advance!
196.6. Cheeven Tsai (2004/08/24 下午 07:22)
In my test, the empty blink appears if your doclink directly follows other html code, for example:
some text before{a href=}{img ....}{/a}
but it will not shows up if your code appears like
some text before {a href=}{img ....}{/a}
it might solve your problem if you insert a white space in front of every doclink before formatter is called.
196.7. Ben Langhinrichs (08/24/2004 08:30 PM)
Now, that sounds extremely promising. I'll give it a try and post back whether it worked. Thanks!