-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from uranusjr/diff
Add diff syntax definition
- Loading branch information
Showing
5 changed files
with
87 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<h1>Diff</h1> | ||
<p>To use this language, use the class "language-diff".</p> | ||
|
||
<h2>Normal Diff</h2> | ||
<pre><code>7c7 | ||
< qt: core | ||
--- | ||
> qt: core quick</code></pre> | ||
|
||
<h2>Context Diff</h2> | ||
<pre><code>*** qcli.yml 2014-12-16 11:43:41.000000000 +0800 | ||
--- /Users/uranusjr/Desktop/qcli.yml 2014-12-31 11:28:08.000000000 +0800 | ||
*************** | ||
*** 4,8 **** | ||
project: | ||
sources: "src/*.cpp" | ||
headers: "src/*.h" | ||
! qt: core | ||
public_headers: "src/*.h" | ||
--- 4,8 ---- | ||
project: | ||
sources: "src/*.cpp" | ||
headers: "src/*.h" | ||
! qt: core gui | ||
public_headers: "src/*.h"</code></pre> | ||
|
||
<h2>Unified Diff</h2> | ||
<pre><code>--- qcli.yml 2014-12-16 11:43:41.000000000 +0800 | ||
+++ /Users/uranusjr/Desktop/qcli.yml 2014-12-31 11:28:08.000000000 +0800 | ||
@@ -4,5 +4,5 @@ | ||
project: | ||
sources: "src/*.cpp" | ||
headers: "src/*.h" | ||
- qt: core | ||
+ qt: core gui | ||
public_headers: "src/*.h"</code></pre> |