Skip to content

Commit 774396c

Browse files
committed
update: 2021-12-26-formatting-testing.md
1 parent 51c7a9c commit 774396c

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

src/articles/blog/2021-12-26-formatting-testing.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tags:
2323
>
2424
> > `this is an inline-quote` does it works? click here to [jump to code-snippet-2](#code-snippet-2), or you can just scroll down, also you can hover on the code blocks.
2525
> >
26-
> > ```npm
26+
> > ```bash
2727
> > npm run install && npm run update
2828
> > ```
2929
> >
@@ -43,6 +43,7 @@ The markdown is being handle by the markdown-it and eleventy, while some extra w
4343
```sql
4444
SELECT * FROM `ikan`;
4545
```
46+
4647
```sql
4748
DROP table `ikan`;
4849
```
@@ -70,7 +71,7 @@ console.log(add(2, 3)) // Output: 5
7071

7172
Here is a simple JavaScript function that adds two numbers and logs the result.
7273

73-
```javascript
74+
```js
7475
const schedulerLoader = (schedules = {}) => {
7576
let time = new Date()
7677
let currentTime = time.getUTCHours() + 9
@@ -95,6 +96,37 @@ const schedulerLoader = (schedules = {}) => {
9596
}
9697
```
9798

99+
```diff:js
100+
const schedulerLoader = (schedules = {}) => {
101+
let time = new Date()
102+
let currentTime = time.getUTCHours() + 9
103+
if (currentTime > 23) currentTime -= 23
104+
105+
if (replaceStatus) replaceStatus.textContent = 'Idle'
106+
- setTimeout(() => throw new Error(),0)
107+
+ setTimeout(() => {
108+
+ for (let i = 0; i < schedules.length; i++) {
109+
+ let { day, endHour, startHour } = schedules[i]
110+
+ if (!replaceStatus) return
111+
+
112+
+ if (days[currentDay] === toCapitalizeWord(day)) {
113+
+ if (currentTime > startHour && currentTime < endHour) {
114+
+ replaceStatus.textContent = 'Studying'
115+
+ }
116+
+ break
117+
+ }
118+
+ replaceStatus.textContent = 'Idle'
119+
+ }
120+
+ }, 0)
121+
```
122+
123+
```md
124+
├─ docs
125+
│ ├─ .vuepress
126+
│ │ └─ config.js
127+
│ └─ README.md
128+
└─ package.json
129+
```
98130
And this is an example of markdown list:
99131

100132
```md
@@ -115,7 +147,6 @@ And this is an example of markdown list:
115147
2. what
116148
3. don't worry
117149

118-
119150
#### Code snippet 3
120151

121152
```js

0 commit comments

Comments
 (0)