Skip to content

Commit 0eb9750

Browse files
committed
fix
1 parent aba666a commit 0eb9750

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

lib/plugins/filter/before_post_render/backtick_code_block.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ function parseArgs(args: string) {
2323
const mark: number[] = [];
2424
let firstLine = 1;
2525
for (let i = 0; i < len; i++) {
26-
const kv = matches[i].split(':');
27-
const key = kv[0];
28-
const value = kv[1];
26+
const [key, value] = matches[i].split(':');
2927

3028
switch (key) {
3129
case 'highlight':
@@ -51,9 +49,7 @@ function parseArgs(args: string) {
5149
let b = +cur.slice(hyphen + 1);
5250
if (Number.isNaN(a) || Number.isNaN(b)) continue;
5351
if (b < a) { // switch a & b
54-
const temp = a;
55-
a = b;
56-
b = temp;
52+
[a, b] = [b, a];
5753
}
5854

5955
for (; a <= b; a++) {

lib/plugins/tag/code.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ function parseArgs(args: string[]): HighlightOptions {
6969
let b = +cur.slice(hyphen + 1);
7070
if (Number.isNaN(a) || Number.isNaN(b)) continue;
7171
if (b < a) { // switch a & b
72-
const temp = a;
73-
a = b;
74-
b = temp;
72+
[a, b] = [b, a];
7573
}
7674

7775
for (; a <= b; a++) {

0 commit comments

Comments
 (0)