Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-jsx.js

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/prism/components/prism-jsx.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-jsx.js b/polymer_1.0.4/bower_components/prism/components/prism-jsx.js
new file mode 100644
index 0000000000000000000000000000000000000000..10c5f097bcd4cf28d36f28f97f09d6d9c4bb339e
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-jsx.js
@@ -0,0 +1,22 @@
+(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': {
+ pattern: /=(\{[\w\W]*?\})/i,
+ inside: {
+ 'function' : Prism.languages.javascript.function,
+ 'punctuation': /[={}[\];(),.:]/,
+ 'keyword': Prism.languages.javascript.keyword
+ },
+ 'alias': 'language-javascript'
+ }
+}, Prism.languages.jsx.tag);
+
+}(Prism));

Powered by Google App Engine
This is Rietveld 408576698