Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 346c639

Browse files
Fixed issue 94: Capital letters at the beginning of XML attribute names are colored incorrectly
1 parent 42629ce commit 346c639

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/prettify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,15 +1203,15 @@ window['_pr_isIE6'] = function () {
12031203
],
12041204
[
12051205
[PR_TAG, /^^<\/?[a-z](?:[\w:-]*\w)?|\/?>$/i],
1206-
[PR_ATTRIB_NAME, /^(?!style\b|on)[a-z](?:[\w:-]*\w)?/],
1206+
[PR_ATTRIB_NAME, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
12071207
['lang-uq.val', /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
12081208
[PR_PUNCTUATION, /^[=<>\/]+/],
12091209
['lang-js', /^on\w+\s*=\s*\"([^\"]+)\"/i],
12101210
['lang-js', /^on\w+\s*=\s*\'([^\']+)\'/i],
12111211
['lang-js', /^on\w+\s*=\s*([^\"\'>\s]+)/i],
1212-
['lang-css', /^sty\w+\s*=\s*\"([^\"]+)\"/i],
1213-
['lang-css', /^sty\w+\s*=\s*\'([^\']+)\'/i],
1214-
['lang-css', /^sty\w+\s*=\s*([^\"\'>\s]+)/i]
1212+
['lang-css', /^style\s*=\s*\"([^\"]+)\"/i],
1213+
['lang-css', /^style\s*=\s*\'([^\']+)\'/i],
1214+
['lang-css', /^style\s*=\s*([^\"\'>\s]+)/i]
12151215
]),
12161216
['in.tag']);
12171217
registerLangHandler(

tests/prettify_test.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ <h1>Issue 92 -- capital letters in tag names</h1>
10561056
&lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
10571057
&lt;Placemark&gt;
10581058
&lt;name&gt;Simple placemark&lt;/name&gt;
1059-
&lt;description&gt;Attached to the ground. Intelligently places itself
1059+
&lt;description Lang="en"&gt;Attached to the ground. Intelligently places itself
10601060
at the height of the underlying terrain.&lt;/description&gt;
10611061
&lt;Point&gt;
10621062
&lt;coordinates&gt;-122.0822035425683,37.42228990140251,0&lt;/coordinates&gt;
@@ -2452,7 +2452,9 @@ <h1>Issue 93 -- C# verbatim strings</h1>
24522452
'`TAG&gt;`END`PLN<br>' +
24532453
'&nbsp; `END`TAG&lt;Placemark&gt;`END`PLN<br>' +
24542454
'&nbsp; &nbsp; `END`TAG&lt;name&gt;`END`PLNSimple placemark`END`TAG&lt;/name&gt;`END`PLN<br>' +
2455-
'&nbsp; &nbsp; `END`TAG&lt;description&gt;`END`PLNAttached to the ground.' +
2455+
'&nbsp; &nbsp; `END`TAG&lt;description`END' +
2456+
'`PLN `END`ATNLang`END`PUN=`END`ATV"en"`END`TAG&gt;`END' +
2457+
'`PLNAttached to the ground.' +
24562458
' Intelligently places itself <br>' +
24572459
'&nbsp; &nbsp; &nbsp; &nbsp;at the height of the underlying terrain.`END' +
24582460
'`TAG&lt;/description&gt;`END`PLN<br>' +

0 commit comments

Comments
 (0)