HTML reformat bugs in <pre> and anchors (FrontPage 2003)

V

verdy_p

The "HTML Reformat" option in FrontPage 2003, even if it is much better than
in previous versions, still suffers from bugs.
One of the most common is that it changes the page layout for sections of
code texts formated with <pre>, when it contains fragments with coloring tags
or anchors.

One example:
<pre>String result = MessageFormat.format(
"At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
<font color="#009900">7</font>, //
{0,number,integer}
new Date(), // {1,date/time}
"a disturbance in the Force" // {2,string}
);
</pre>
When reformated, it becomes:
<pre>String result = MessageFormat.format(
"At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
<font color="#009900">7</font>, //
{0,number,integer}
new Date(), // {1,date/time}
"a disturbance in the Force" // {2,string}
);
</pre>
where *significant* whitespaces around the <font> and </font> tags are
dropped.

The "HTML Reformat" option is also not correct with anchors, as it allows
inserting a line break (i.e. a whitespace) after the initial <a href="...">
tag (on many browsers, this will produce a line-break opportunity and will
often underline this whitespace); This changes the layout because anchors are
inline elements, where inner whitespaces can be normalized but cannot (should
not) be ignored according to the HTML specifications.

On the opposite, it leaves an unnecessary whitespace before closing tags
</td> or </p> or </li>... of block elements. These also apply with the
"Optimize HTML".

-- Philippe.
 
J

Jens Peter Karlsen[FP MVP]

When you want to display script on a page so it can be copied and
pasted, you should do so in a text area. That is the only safe way.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top