Blame view

bower_components/prism/components/prism-jsx.js 807 Bytes
73bcce88   luigser   COMPONENTS
1
2
3
4
5
6
7
8
9
10
11
  (function(Prism) {
  
  var javascript = Prism.util.clone(Prism.languages.javascript);
  
  Prism.languages.jsx = Prism.languages.extend('markup', javascript);
  Prism.languages.jsx.tag.pattern= /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i;
  
  Prism.languages.jsx.tag.inside['attr-value'].pattern = /=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i;
  
  Prism.languages.insertBefore('inside', 'attr-value',{
  	'script': {
eb240478   Luigi Serra   public room cards...
12
13
  		// Allow for one level of nesting
  		pattern: /=(\{(?:\{[^}]*\}|[^}])+\})/i,
73bcce88   luigser   COMPONENTS
14
15
16
  		inside: {
  			'function' : Prism.languages.javascript.function,
  			'punctuation': /[={}[\];(),.:]/,
f748e9cf   Luigi Serra   new controllet an...
17
18
  			'keyword':  Prism.languages.javascript.keyword,
  			'boolean': Prism.languages.javascript.boolean
73bcce88   luigser   COMPONENTS
19
20
21
22
23
24
  		},
  		'alias': 'language-javascript'
  	}
  }, Prism.languages.jsx.tag);
  
  }(Prism));