Commit 52d40a283f068b5d90432fe79b2b1ceda7e9b8fc

Lea Verou 2013-12-15T04:27:09

Merge pull request #189 from dwachss/gh-pages Allow more characters in attribute values

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/components/prism-markup.js b/components/prism-markup.js
index c5f3d14..56dad70 100644
--- a/components/prism-markup.js
+++ b/components/prism-markup.js
@@ -4,7 +4,7 @@ Prism.languages.markup = {
 	'doctype': /<!DOCTYPE.+?>/,
 	'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
 	'tag': {
-		pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,
+		pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,
 		inside: {
 			'tag': {
 				pattern: /^<\/?[\w:-]+/i,
@@ -38,4 +38,4 @@ Prism.hooks.add('wrap', function(env) {
 	if (env.type === 'entity') {
 		env.attributes['title'] = env.content.replace(/&/, '&');
 	}
-});
\ No newline at end of file
+});