Skip to content

Commit 82b9e92

Browse files
authored
optimize diff highlighting (#3912)
1 parent 56d0618 commit 82b9e92

File tree

3 files changed

+46
-28
lines changed

3 files changed

+46
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"remark-custom-blockquotes": "1.0.0",
136136
"remark-extract-anchors": "1.1.1",
137137
"remark-loader": "^0.3.0",
138-
"remark-refractor": "1.1.0",
138+
"remark-refractor": "git://github.com/montogeek/remark-refractor.git",
139139
"remark-responsive-tables": "1.0.0",
140140
"remark-slug": "^5.0.0",
141141
"request-promise": "4.2.4",

src/styles/index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ button.as-link {
4646
::selection {
4747
background: transparentize(getColor(malibu), 0.65);
4848
}
49+
50+
.language-diff {
51+
.token.prefix.inserted, .token.prefix.deleted {
52+
user-select: none;
53+
}
54+
}

yarn.lock

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6022,15 +6022,14 @@ hast-util-whitespace@^1.0.0:
60226022
resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41"
60236023
integrity sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A==
60246024

6025-
hastscript@^3.1.0:
6026-
version "3.1.0"
6027-
resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-3.1.0.tgz#66628ba6d7f1ad07d9277dd09028aba7f4934599"
6028-
integrity sha512-8V34dMSDT1Ik+ZSgTzCLdyp89MrWxcxctXPxhmb72GQj1Xkw1aHPM9UaHCWewvH2Q+PVkYUm4ZJVw4T0dgEGNA==
6025+
hastscript@^5.0.0:
6026+
version "5.1.2"
6027+
resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a"
6028+
integrity sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ==
60296029
dependencies:
6030-
camelcase "^3.0.0"
60316030
comma-separated-tokens "^1.0.0"
60326031
hast-util-parse-selector "^2.0.0"
6033-
property-information "^3.0.0"
6032+
property-information "^5.0.0"
60346033
space-separated-tokens "^1.0.0"
60356034

60366035
he@1.2.x, he@^1.1.1, he@^1.2.0:
@@ -9798,6 +9797,18 @@ parse-entities@^1.0.2, parse-entities@^1.1.0:
97989797
is-decimal "^1.0.0"
97999798
is-hexadecimal "^1.0.0"
98009799

9800+
parse-entities@^2.0.0:
9801+
version "2.0.0"
9802+
resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8"
9803+
integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==
9804+
dependencies:
9805+
character-entities "^1.0.0"
9806+
character-entities-legacy "^1.0.0"
9807+
character-reference-invalid "^1.0.0"
9808+
is-alphanumerical "^1.0.0"
9809+
is-decimal "^1.0.0"
9810+
is-hexadecimal "^1.0.0"
9811+
98019812
parse-glob@^3.0.4:
98029813
version "3.0.4"
98039814
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
@@ -10783,15 +10794,10 @@ prettycli@^1.4.3:
1078310794
dependencies:
1078410795
chalk "2.1.0"
1078510796

10786-
prism-languages@0.4.0:
10787-
version "0.4.0"
10788-
resolved "https://registry.yarnpkg.com/prism-languages/-/prism-languages-0.4.0.tgz#7b36964ac896909f888d3355aa9ac6055b116e87"
10789-
integrity sha512-Qfg/joAMAV3Dl0Ot79WV+5TZQUh9pc149HEtBO5/APiWzMAL8rJmBvH8C7uIlScBQpdW9KOQqm60wuHbKWbOVg==
10790-
10791-
prismjs@~1.14.0:
10792-
version "1.14.0"
10793-
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.14.0.tgz#bbccfdb8be5d850d26453933cb50122ca0362ae0"
10794-
integrity sha512-sa2s4m60bXs+kU3jcuUwx3ZCrUH7o0kuqnOOINbODqlRrDB7KY8SRx+xR/D7nHLlgfDdG7zXbRO8wJ+su5Ls0A==
10797+
prismjs@~1.21.0:
10798+
version "1.21.0"
10799+
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3"
10800+
integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw==
1079510801
optionalDependencies:
1079610802
clipboard "^2.0.0"
1079710803

@@ -10864,6 +10870,13 @@ property-information@^3.0.0, property-information@^3.1.0:
1086410870
resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.2.0.tgz#fd1483c8fbac61808f5fe359e7693a1f48a58331"
1086510871
integrity sha1-/RSDyPusYYCPX+NZ52k6H0ilgzE=
1086610872

10873+
property-information@^5.0.0:
10874+
version "5.5.0"
10875+
resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.5.0.tgz#4dc075d493061a82e2b7d096f406e076ed859943"
10876+
integrity sha512-RgEbCx2HLa1chNgvChcx+rrCWD0ctBmGSE0M7lVm1yyv4UbvbrWoXp/BkVLZefzjrRBGW8/Js6uh/BnlHXFyjA==
10877+
dependencies:
10878+
xtend "^4.0.0"
10879+
1086710880
proxy-addr@~2.0.5:
1086810881
version "2.0.6"
1086910882
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf"
@@ -11427,13 +11440,14 @@ redux@^3.3.0:
1142711440
loose-envify "^1.1.0"
1142811441
symbol-observable "^1.0.3"
1142911442

11430-
refractor@2.4.1:
11431-
version "2.4.1"
11432-
resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.4.1.tgz#067654311ed1618fc2dd76e9263c8cf05ab6298b"
11433-
integrity sha512-8RDCtd1fWCYcR82d4B0ziv5zWnEXqlW4rBspnpqJffqFAcp34V0wmM1NqjLFUnEGfdvygBSmKSRGIZXf13Yohg==
11443+
refractor@^3.1.0:
11444+
version "3.1.0"
11445+
resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.1.0.tgz#b05a43c8a1b4fccb30001ffcbd5cd781f7f06f78"
11446+
integrity sha512-bN8GvY6hpeXfC4SzWmYNQGLLF2ZakRDNBkgCL0vvl5hnpMrnyURk8Mv61v6pzn4/RBHzSWLp44SzMmVHqMGNww==
1143411447
dependencies:
11435-
hastscript "^3.1.0"
11436-
prismjs "~1.14.0"
11448+
hastscript "^5.0.0"
11449+
parse-entities "^2.0.0"
11450+
prismjs "~1.21.0"
1143711451

1143811452
regenerate-unicode-properties@^8.2.0:
1143911453
version "8.2.0"
@@ -11695,13 +11709,11 @@ remark-react@^4.0.0:
1169511709
hast-util-sanitize "^1.0.0"
1169611710
mdast-util-to-hast "^3.0.0"
1169711711

11698-
remark-refractor@1.1.0:
11699-
version "1.1.0"
11700-
resolved "https://registry.yarnpkg.com/remark-refractor/-/remark-refractor-1.1.0.tgz#efc5dd599494387e6b8952916014ec79deea6559"
11701-
integrity sha512-EKlPS92ymM852QQKOzyVEs/UcdMKe0f7A1FfHle2NCHsvrCFPdb4uQly0BReF3mb61zrVRNyILtngezQwWr0Yw==
11712+
"remark-refractor@git://github.com/montogeek/remark-refractor.git":
11713+
version "1.0.0"
11714+
resolved "git://github.com/montogeek/remark-refractor.git#9b6048f89739b27f9de701d29d29d980b3ea18d7"
1170211715
dependencies:
11703-
prism-languages "0.4.0"
11704-
refractor "2.4.1"
11716+
refractor "^3.1.0"
1170511717
unist-util-visit "1.3.1"
1170611718

1170711719
remark-responsive-tables@1.0.0:

0 commit comments

Comments
 (0)