sandeeprsp / syntaxhighlighter

Automatically exported from code.google.com/p/syntaxhighlighter
GNU General Public License v3.0
0 stars 0 forks source link

Comments in XML Destroys Element Nesting #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. An XML file with HTML comments in it causes the formatter to incorrectly
generate extra end node elements, and causes formatting to render incorrectly. 

What is the expected output? What do you see instead?
Incorrect end elements that should not be there.

What version of the product are you using? On what operating system?
1.51/Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by brian...@gmail.com on 19 Mar 2008 at 3:22

GoogleCodeExporter commented 8 years ago
To add, the comments look like this, and it seems the parser is having issues 
with
the multi-line comments:

<!--  
The column on the intermediary table that links back  
to the primary key on the main table  
-->  

Original comment by brian...@gmail.com on 19 Mar 2008 at 3:26

GoogleCodeExporter commented 8 years ago
Hi the Regex for comments in XML stumbles upon newlines. Use this one instead:

// Match comments
// (\<|<)!--\s*(\s|.)*?\s*--(\>|>)
this.GetMatches(new RegExp('(\<|<)!--\\s*(\\s|.)*?\\s*--(\>|>)', 'gm'),
'comments');

Original comment by yoshtec on 15 Nov 2008 at 10:03