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

Commit 585e375

Browse files
author
mikesamuel@gmail.com
committed
fixed issue 262 : prefixes of CSS ID selectors that were hex digits colorized differently from suffix
1 parent c696077 commit 585e375

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGES.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ <h2>29 March 2011</h2>
154154
<h2>4 February 2013</h2>
155155
<ul>
156156
<li>Language handlers for Dart, TCL.</li>
157-
<li>Bug fixes : VB REM style comments.</li>
157+
<li>Bug fix: VB REM style comments</li>
158+
<li>Bug fix: CSS color literals / ID selector confusion.</li>
158159
</ul>
159160
</body>
160161
</html>

src/lang-css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ PR['registerLangHandler'](
131131
// A number possibly containing a suffix.
132132
[PR['PR_LITERAL'], /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
133133
// A hex color
134-
[PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}/i],
134+
[PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}\b/i],
135135
// An identifier
136136
[PR['PR_PLAIN'],
137137
/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],

tests/prettify_test.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@ <h1>CSS w/ language specified</h1>
11001100
blink { text-decoration: BLINK !IMPORTANT; font-weight: bolder }
11011101
/* Empty url() was causing infinite recursion */
11021102
a { background-image: url(); }
1103+
p#featured{background:#fea}
11031104
--&gt;
11041105
</pre>
11051106

@@ -2764,6 +2765,7 @@ <h1>Go mode</h1>
27642765
'`END`COM/* Empty url() was causing infinite recursion */`END`PLN\n' +
27652766
'a `END`PUN{`END`PLN `END`KWDbackground-image`END`PUN:`END`PLN ' +
27662767
'`END`KWDurl`END`PUN();`END`PLN `END`PUN}`END`PLN\n' +
2768+
'p`END`PUN#`END`PLNfeatured`END`PUN{`END`KWDbackground`END`PUN:`END`LIT#fea`END`PUN}`END`PLN\n' +
27672769
'`END`COM--&gt;`END'
27682770
),
27692771
issue79: (

0 commit comments

Comments
 (0)