WPCubed Product Support

HTML Writer - bug with hyperlinks

Hi, I have troubles with HTML Writer in combination with hyperlinks. The writer wrongly closes font tag in generated HTML page. Here is the example

-------GENERATED HTML CODE-------------
<div>
<font>Some text
<ahref>
</font>
<i>
<font>Hyprlink text</font>
</i>
<font></a>
not hyperlinked text.
</font>
</div>


You can see, that a href tag is placed inside the font tag. The same is for closing a tag. The correct output should be

------------CORRECT CODE-----------------
<div>
<font>Some text</font>
<ahref>
<i>
<font>Hyprlink text</font>
</i></a>
<font>
not hyperlinked text.
</font>
</div>


The code above is just short part of the whole html file. The main problem is the order of the open and close tags. Please send us the bugfix or tips how to correct this.

With regards
Petr Slipek.

#1 ♥ 0
3.5k Views 2 users read 2 min
support

Hi,

in function TWPHTMLWriter.WriteObject

unit WPIOHTML

You can activate some commented code:

start:
if wpobjUsedPairwise in txtobj.Mode then
begin
FRestoreCharAttr := FCharAttr.CharAttr;
UpdateCharAttr(0);
end else FRestoreCharAttr := 0;

end:
if FRestoreCharAttr <> 0 then
begin
UpdateCharAttr(FRestoreCharAttr);
end;

Which should help to create the HTML code you expect.

Julian

#2 ♥ 0

Hi,

thanks for quick reply. It works now as expected.

Is there any reason, why was the lines commented? To be aware of any troubles iin some situations?

Petr Slipek.

#3 ♥ 0
support

Hi,

It makes the HTML file larger and can break up texts which would be logically one piece. The output without is not really wrong, it is just not X-HTML.

Julian

#4 ♥ 0
This category is archived. No new posts are possible.