ASP comments can break HTML highlighting/checking

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

ASP comments can break HTML highlighting/checking

Post by MikeyB »

Hi,

Had this problem ever since using WeBuilder, can't find it using the search, so finally thought I'd post about it.

Basically having an ASP comment and an ASP end tag (%>) on the same line will "break" HTML highlighting & syntax check following it, until the next %> asp end tag.

A couple of images to show better:
This is fine, no problems at all:
Image

Now I've added a comment to line 121, and the %> tag is on the same line. This is valid ASP and doesn't break in other editors:
Image
You'll now see that the ASP tag on line 121 is now grey as part of the comment rather than yellow.
The HTML below is now treated as ASP code and the highlighting changes colours (<html lang="en"> etc)
This happens till the next %> tag on line 124
But now the </title> is red because WeBuilder thinks the <title> tag is ASP code rather than HTML code.

This can be rather annoying if there is a large block of HTML till the next found %> tag as all the HTML will be coloured wrong and the highlighting of matching & missing HTML tags no longer works.

Cheers,
Mike
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: ASP comments can break HTML highlighting/checking

Post by chrisjlocke »

Possibly a bug in the highlighting (but the highlighting script is quite complex!) but ideally, the %> should be on its own line, rather than on the same line as a comment.
User avatar
MikeyB
Top Contributor
Posts: 511
Joined: Fri Jun 09, 2006 10:38 am
Location: UK
Contact:

Re: ASP comments can break HTML highlighting/checking

Post by MikeyB »

I did have a play with the highlighting scripts, but didn't come up with anything that worked.

It's not a major problem, just one of those slight annoying things when looking at your code trying to work out what's wrong with it!
x3po
Posts: 139
Joined: Fri May 16, 2008 10:48 am

Re: ASP comments can break HTML highlighting/checking

Post by x3po »

i have issues with the highlighting in asp too, when using single line comments like shown here:
Image

Is there the slight chance to get this fixed anytime?
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: ASP comments can break HTML highlighting/checking

Post by Karlis »

You can try to fix this by customizing the syntax highlighter. There is more info about this in the help. In fact, you can make whatever changes to the syntax highlighter, by modifying the syntax parser script.
Karlis Blumentals
Blumentals Software
www.blumentals.net
Post Reply