Skip to content

Commit ef60535

Browse files
authoredAug 19, 2024
Merge pull request #59 from jaredwray/moving-to-nodejs-20-and-22.-removing-support-for-18
moving to nodejs 20 and 22. removing support for 18
2 parents 0c04233 + e36f50f commit ef60535

File tree

8 files changed

+57
-23
lines changed

8 files changed

+57
-23
lines changed
 

‎.github/workflows/code-coverage.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: code-coverage
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
code-coverage:
12+
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: ['20']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install Dependencies
27+
run: npm install
28+
29+
- name: Testing
30+
run: npm run test:ci
31+
32+
- name: Code Coverage
33+
uses: codecov/codecov-action@v3
34+
with:
35+
token: ${{ secrets.CODECOV_KEY }}
36+
verbose: true

‎.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "codeql"
1313

1414
on:
1515
push:

‎.github/workflows/deploy-site.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18]
15+
node-version: ['20']
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
# Test
2222
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626

‎.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ on:
66
types: [released]
77

88
jobs:
9-
build:
9+
setup-build-release:
1010

1111
runs-on: ubuntu-latest
1212

1313
strategy:
1414
matrix:
15-
node-version: [18]
15+
node-version: ['20']
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323

‎.github/workflows/tests.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,23 @@ on:
88
branches: [ main ]
99

1010
jobs:
11-
build:
11+
setup-build-tests:
1212

1313
runs-on: ubuntu-latest
1414

1515
strategy:
1616
matrix:
17-
node-version: ['18', '20']
17+
node-version: ['20', '22']
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525

2626
- name: Install Dependencies
2727
run: npm install
2828

2929
- name: Testing
30-
run: npm run test:ci
31-
32-
- name: Code Coverage
33-
uses: codecov/codecov-action@v3
34-
with:
35-
token: ${{ secrets.CODECOV_KEY }}
36-
verbose: true
30+
run: npm run test:ci

‎.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"require": "./index.js"
104104
},
105105
"engines": {
106-
"node": ">=14"
106+
"node": ">=20"
107107
},
108108
"scripts": {
109109
"test": "c8 mocha --reporter list",
@@ -129,7 +129,7 @@
129129
"handlebars-utils": "^1.0.6",
130130
"has-value": "^2.0.2",
131131
"helper-date": "^1.0.1",
132-
"highlight.js": "^11.9.0",
132+
"highlight.js": "^11.10.0",
133133
"html-tag": "^2.0.0",
134134
"is-even": "^1.0.0",
135135
"is-glob": "^4.0.3",

‎test/md.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ describe('highlight:', function(argument) {
130130
highlight: function(code, lang) {
131131
try {
132132
try {
133-
return hljs.highlight(lang, code).value;
133+
if(lang) {
134+
return hljs.highlight(code,{language: lang}).value;
135+
} else {
136+
return hljs.highlightAuto(code).value;
137+
}
134138
} catch (err) {
135139
if (!/Unknown language/i.test(err.message)) {
136140
throw err;

0 commit comments

Comments
 (0)