Collapse lines does not work properly for HTML - reason?

Syntax highlighting, code folding, brace matching, code indenting, and function list

Collapse lines does not work properly for HTML - reason?

Postby drewdin » Thu Aug 05, 2010 9:29 am

I have been making some html files and I noticed that when it creates the collapsing lines they do not work properly. If I have the html, head and body it works fine. If I put anything in between the little pluses go spar-attic around the page and make no sense? Has anyone else had this problem?
drewdin
Newbie
 
Posts: 2
Joined: Thu Aug 05, 2010 9:22 am

Re: Collapse lines does not work properly for HTML - reason?

Postby Mofi » Fri Aug 06, 2010 1:05 am

Which version of UltraEdit do you use, v16.10.0.1036?

The code folding feature works fine for my valid HTML files encoded in ANSI using character set "iso-8859-1", except for one file which contains blocks like this:

<table cellspacing=0 summary="Beispiel f&uuml;r Befehl ME">
<tr><td>Anfrage:</td>
 <td><span class="reb">:</span><span class="db">0A</span><span class="veid">TEST</span><!--
//-->
<span class="or">ME</span>0000<span class="pi">6E</span></td>
</tr><tr><td>Antwort:&nbsp;</td>
 <td><span class="reb">:</span><span class="db">0E</span><span class="veid">TEST</span><!--
//-->
<span class="or">ME</span>00000001<span class="pi">AD</span></td>
</tr></table>

The block comment starting at end of a line and immediately ending on start of the next line to be able to well format the long string in the HTML file without resulting in displaying the line ending as space character confuses the code folding engine of UltraEdit. With HTML block comments used "normally" there is no problem.

Of course the HTML file must be valid which means for every block element starting tag there must be also a block element ending tag. Further in HTML 4.01 it is for some block elements like <li> or <td> valid to omit the end tag </li> or </td> which is not allowed when using XHTML and of course is also for HTML not really good. If block ending tags are omitted, the code folding engine fails. For example following HTML code is no problem for the code folding engine.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
 <title>Code Folding test</title>
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<ul>
 <li>Multi-line
  list item
  in a bulleted list.
</li>
 <li>Two line list item
  in a bulleted list.</li>
 <li>Single line list item in a bulleted list.</li>
</ul>
</body>
</html>


But if </li> is omitted, code folding fails although the HTML file is still a valid HTML file.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Collapse lines does not work properly for HTML - reason?

Postby drewdin » Fri Aug 06, 2010 8:28 am

Thanks for the reply, I'm using the currently latest version 16.10.0.1036. I figured out whats going on and I think it might be a bug.

I created an xhtml document and tested it using the validation from w3. After I had the page finished I realized that I wanted to change the layout, so I was cutting and pasting stuff around the page. That's where the collapsing failed.

I know the document is good because it still passes the validation and I'm using xhtml 1.0 strict. It shows some plussed that collapse half the page while other don't have a plus and don't collapse at all. The only way I could fix it was to delete the page and re-do it.

What a pain in the butt! I'm going to submit it as a bug.
drewdin
Newbie
 
Posts: 2
Joined: Thu Aug 05, 2010 9:22 am


Return to Syntax Highlighting

cron