"Copy as HTML page" produces invalid html

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
bveldkamp

"Copy as HTML page" produces invalid html

Post by bveldkamp »

When I copy some Java code as HTML, only the first line of a multi-line comment is show as a comment. This is caused by P and SPAN tags that are not properly nested (Just run Tidy if you don't know what I mean). Here's the resulting html:

Code: Select all

<body class="TPtext">
<p><span class="TPcomment">/*</p>
<p style="padding-left:1ex;"> * MyClass.java</p>
<p style="padding-left:1ex;"> *</p>
<p style="padding-left:1ex;"> * Created on 29 mei 2008, 15:46</p>
<p style="padding-left:1ex;"> *</p>
<p style="padding-left:1ex;"> * To change this template, choose Tools | Template Manager</p>
<p style="padding-left:1ex;"> * and open the template in the editor.</p>
<p style="padding-left:1ex;"> */</span></p>
Since a SPAN cannot contain a P, only the first line will have the TPComment class. For some reason, Opera and Internet Explorer show the comments as intended, Safari and Firefox do not.
webwiz
Posts: 6
Joined: Thu Jul 27, 2006 7:39 pm
Location: Oakland, California
Contact:

Re: "Copy as HTML page"

Post by webwiz »

Yes. That code does not look too healthy.

Try this: http://textile.thresholdstate.com/
Cordially, David
--
"Eschew obfuscation"
Post Reply