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

Unified Diff: lib/src/prism/components/prism-diff.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 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
« no previous file with comments | « lib/src/prism/components/prism-d.min.js ('k') | lib/src/prism/components/prism-diff.min.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/prism/components/prism-diff.js
diff --git a/lib/src/prism/components/prism-diff.js b/lib/src/prism/components/prism-diff.js
new file mode 100644
index 0000000000000000000000000000000000000000..3c5351c0b6753870552e07e4f9e3521504837946
--- /dev/null
+++ b/lib/src/prism/components/prism-diff.js
@@ -0,0 +1,20 @@
+Prism.languages.diff = {
+ 'coord': [
+ // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
+ /^(?:\*{3}|-{3}|\+{3}).*$/m,
+ // Match "@@ ... @@" coord lines in unified diff.
+ /^@@.*@@$/m,
+ // Match coord lines in normal diff (starts with a number).
+ /^\d+.*$/m
+ ],
+
+ // Match inserted and deleted lines. Support both +/- and >/< styles.
+ 'deleted': /^[-<].+$/m,
+ 'inserted': /^[+>].+$/m,
+
+ // Match "different" lines (prefixed with "!") in context diff.
+ 'diff': {
+ 'pattern': /^!(?!!).+$/m,
+ 'alias': 'important'
+ }
+};
« no previous file with comments | « lib/src/prism/components/prism-d.min.js ('k') | lib/src/prism/components/prism-diff.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698