JSP comments in jsp-nxhtml mode are not handled properly

Bug #690266 reported by chris.dow8
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Fix Committed
Medium
Unassigned

Bug Description

In jsp-nxhtml mode it appears that text between JSP comment tags (<%-- --%>) are being highlighted as if they were Java code. Java keywords and symbols are being highlighted in these comments. This causes problems especially if there is an odd number of single or double quotes inside a JSP comment because the closing comment tag will be treated as part of a Java string which screws up the highlighting of the entire file.

I was able to repeat this issue after running 'emacs-Q-nxhtml'

Version:
  nXhtml: 2.08
  Emacs: 23.2.1
  OS: Windows 7

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks Chris, is it possible that you can send a simple example file too?

Changed in nxhtml:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
chris.dow8 (christopher-dow) wrote :

Thanks for looking in to this so quick. Attached is an example file.

Revision history for this message
lborgman (lennart-borgman) wrote :

Some things are easy to fix - I hope this is one of them. This was an oversight, I did not know about the jsp hidden comment syntax.

I have uploaded a new beta 2.09 to the repository. Can you please test that?

Revision history for this message
chris.dow8 (christopher-dow) wrote :

That did not seem to fix it. Let me know if you need any additional info.

Revision history for this message
lborgman (lennart-borgman) wrote :

Sorry, my bad. I forgot to update one file. Please try again.

Revision history for this message
chris.dow8 (christopher-dow) wrote :

That fixed the comments but broke Java syntax highlighting for the regular JSP tags ('<%' and '%>'). It looks like the matching for JSP comments was too aggressive and was matching everything as a comment. I attached a patch that seems to fix this. Thanks for all of your help.

Revision history for this message
lborgman (lennart-borgman) wrote :

Ah, sorry. just a stupid mistake. (I changed the comment but not the code.)

Sorry for wasting our time. I think it is ok now. Please try again.

Revision history for this message
chris.dow8 (christopher-dow) wrote :

That fixed it completely. Thanks again.

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks. I have no chance fixing things like this without bug reports.

Changed in nxhtml:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.