Commit a74ff8782a9efa2fbb336bace4e733e91b88b391

Daniel Wachsstock 2013-12-14T19:36:16

Allow more characters in attribute values The current pattern uses `\w+` but the [html5 grammar](http://www.w3.org/html/wg/drafts/html/master/syntax.html#attribute-value-(unquoted%29-state) allows just about any character, `[^\s'">=]+`

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
+});