Blame view

bower_components/prism/components/prism-markup.js 1.1 KB
73bcce88   luigser   COMPONENTS
1
2
3
4
5
6
  Prism.languages.markup = {
  	'comment': /<!--[\w\W]*?-->/,
  	'prolog': /<\?[\w\W]+?\?>/,
  	'doctype': /<!DOCTYPE[\w\W]+?>/,
  	'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
  	'tag': {
f748e9cf   Luigi Serra   new controllet an...
7
  		pattern: /<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
73bcce88   luigser   COMPONENTS
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  		inside: {
  			'tag': {
  				pattern: /^<\/?[^\s>\/]+/i,
  				inside: {
  					'punctuation': /^<\/?/,
  					'namespace': /^[^\s>\/:]+:/
  				}
  			},
  			'attr-value': {
  				pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
  				inside: {
  					'punctuation': /[=>"']/
  				}
  			},
  			'punctuation': /\/?>/,
  			'attr-name': {
  				pattern: /[^\s>\/]+/,
  				inside: {
  					'namespace': /^[^\s>\/:]+:/
  				}
  			}
  
  		}
  	},
  	'entity': /&#?[\da-z]{1,8};/i
  };
  
  // Plugin to make entity title show the real entity, idea by Roman Komarov
  Prism.hooks.add('wrap', function(env) {
  
  	if (env.type === 'entity') {
  		env.attributes['title'] = env.content.replace(/&amp;/, '&');
  	}
  });
eb240478   Luigi Serra   public room cards...
42
43
44
45
46
  
  Prism.languages.xml = Prism.languages.markup;
  Prism.languages.html = Prism.languages.markup;
  Prism.languages.mathml = Prism.languages.markup;
  Prism.languages.svg = Prism.languages.markup;