Page 1 of 1

"Copy as HTML page" produces invalid html

Posted: Mon Jun 09, 2008 2:56 pm
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.

Re: "Copy as HTML page"

Posted: Sat Jun 21, 2008 3:37 am
by webwiz
Yes. That code does not look too healthy.

Try this: http://textile.thresholdstate.com/