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

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-css.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-css.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-css.js b/polymer_1.0.4/bower_components/prism/components/prism-css.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b0b7218891b5e7e513519a1d4b4f2d6e00cd70d
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-css.js
@@ -0,0 +1,50 @@
+Prism.languages.css = {
+ 'comment': /\/\*[\w\W]*?\*\//,
+ 'atrule': {
+ pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
+ inside: {
+ 'punctuation': /[;:]/
+ }
+ },
+ 'url': /url\((?:(["'])(\\\n|\\?.)*?\1|.*?)\)/i,
+ 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/,
+ 'string': /("|')(\\\n|\\?.)*?\1/,
+ 'property': /(\b|\B)[\w-]+(?=\s*:)/i,
+ 'important': /\B!important\b/i,
+ 'punctuation': /[\{\};:]/,
+ 'function': /[-a-z0-9]+(?=\()/i
+};
+
+if (Prism.languages.markup) {
+ Prism.languages.insertBefore('markup', 'tag', {
+ 'style': {
+ pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i,
+ inside: {
+ 'tag': {
+ pattern: /<style[\w\W]*?>|<\/style>/i,
+ inside: Prism.languages.markup.tag.inside
+ },
+ rest: Prism.languages.css
+ },
+ alias: 'language-css'
+ }
+ });
+
+ Prism.languages.insertBefore('inside', 'attr-value', {
+ 'style-attr': {
+ pattern: /\s*style=("|').*?\1/i,
+ inside: {
+ 'attr-name': {
+ pattern: /^\s*style/i,
+ inside: Prism.languages.markup.tag.inside
+ },
+ 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
+ 'attr-value': {
+ pattern: /.+/i,
+ inside: Prism.languages.css
+ }
+ },
+ alias: 'language-css'
+ }
+ }, Prism.languages.markup.tag);
+}

Powered by Google App Engine
This is Rietveld 408576698