Skip to content

Commit 8929075

Browse files
authored
Merge branch 'master' into fix/issue-1284
2 parents cca4b39 + 440f593 commit 8929075

18 files changed

+224
-437
lines changed

.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@ updates:
55
schedule:
66
interval: monthly
77
versioning-strategy: increase
8+
open-pull-requests-limit: 99
9+
groups:
10+
dependencies:
11+
applies-to: version-updates
12+
patterns:
13+
- '*'
14+
update-types:
15+
- 'minor'
16+
- 'patch'
817
- package-ecosystem: npm
918
directory: '/website'
1019
schedule:
1120
interval: monthly
1221
versioning-strategy: increase
22+
open-pull-requests-limit: 99
23+
groups:
24+
dependencies:
25+
applies-to: version-updates
26+
patterns:
27+
- '*'
28+
update-types:
29+
- 'minor'
30+
- 'patch'
1331
- package-ecosystem: npm
1432
directory: '/website/plugins/docusaurus-plugin-hotjar'
1533
schedule:

.github/labeler.yml

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
---
21
# labels auto assigned to PR, keep in sync with labels.yml
32
test:
4-
- test/**/*.spec.**
3+
- changed-files:
4+
- any-glob-to-any-file:
5+
- test/**/*.spec.*
56
dependencies:
6-
- package.json
7-
- yarn.lock
8-
- package-lock.json
9-
documentation: -**.md
10-
-**/**/*.md
11-
- website/**/*
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- package.json
10+
- yarn.lock
11+
- package-lock.json
12+
documentation:
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- '**/**.md'
16+
- website/
1217
automation:
13-
- .github/*
14-
- .github/**/*
18+
- changed-files:
19+
- any-glob-to-any-file:
20+
- .github/
1521
core:
16-
- src/core/**/*
22+
- changed-files:
23+
- any-glob-to-any-file:
24+
- src/core/
1725
cli:
18-
- src/cli/**/*
26+
- changed-files:
27+
- any-glob-to-any-file:
28+
- src/cli/

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- name: Initialize CodeQL
2727
uses: github/codeql-action/init@v3

.github/workflows/development.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: ⬇️ Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: ⎔ Setup node ${{ matrix.node }}
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
2323
cache: npm
2424

@@ -35,22 +35,23 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
node:
38-
- 14
39-
- 16
4038
- 18
39+
- 20
40+
- 22
41+
- 23
4142
os: [ubuntu-latest, macos-latest, windows-latest]
4243

4344
steps:
4445
- name: 🛑 Cancel Previous Runs
45-
uses: styfle/[email protected].0
46+
uses: styfle/[email protected].1
4647
with:
4748
access_token: ${{ secrets.GITHUB_TOKEN }}
4849

4950
- name: ⬇️ Checkout
50-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5152

5253
- name: ⎔ Setup node ${{ matrix.node }}
53-
uses: actions/setup-node@v3
54+
uses: actions/setup-node@v4
5455
with:
5556
node-version: ${{ matrix.node }}
5657
cache: npm
@@ -65,24 +66,25 @@ jobs:
6566
run: git diff --exit-code
6667

6768
- name: Run tests
68-
if: matrix.node != '16' || matrix.os != 'ubuntu-latest'
69-
uses: nick-invision/retry@v2
69+
if: matrix.node != '18' || matrix.os != 'ubuntu-latest'
70+
uses: nick-invision/retry@v3
7071
with:
7172
timeout_minutes: 20
7273
max_attempts: 3
7374
command: npm run test
7475

7576
- name: Run coverage
76-
if: matrix.node == '16' && matrix.os == 'ubuntu-latest'
77-
uses: nick-invision/retry@v2
77+
if: matrix.node == '18' && matrix.os == 'ubuntu-latest'
78+
uses: nick-invision/retry@v3
7879
with:
7980
timeout_minutes: 20
8081
max_attempts: 3
8182
command: npm run test:coverage
8283

8384
- name: ⬆️ Upload coverage to Codecov
84-
if: matrix.node == '16' && matrix.os == 'ubuntu-latest'
85-
uses: codecov/codecov-action@v3
85+
if: matrix.node == '18' && matrix.os == 'ubuntu-latest'
86+
uses: codecov/codecov-action@v5
8687
with:
8788
files: ./coverage/coverage-final.json
8889
name: codecov-dev
90+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
triage:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/labeler@v4
10+
- uses: actions/labeler@v5
1111
with:
1212
repo-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/production.yml

+18-16
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: ⬇️ Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: ⎔ Setup node ${{ matrix.node }}
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
2323
cache: npm
2424

@@ -35,22 +35,23 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
node:
38-
- 14
39-
- 16
4038
- 18
39+
- 20
40+
- 22
41+
- 23
4142
os: [ubuntu-latest, macos-latest, windows-latest]
4243

4344
steps:
4445
- name: 🛑 Cancel Previous Runs
45-
uses: styfle/[email protected].0
46+
uses: styfle/[email protected].1
4647
with:
4748
access_token: ${{ secrets.GITHUB_TOKEN }}
4849

4950
- name: ⬇️ Checkout
50-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
5152

5253
- name: ⎔ Setup node ${{ matrix.node }}
53-
uses: actions/setup-node@v3
54+
uses: actions/setup-node@v4
5455
with:
5556
node-version: ${{ matrix.node }}
5657
cache: npm
@@ -65,27 +66,28 @@ jobs:
6566
run: git diff --exit-code
6667

6768
- name: Run tests
68-
if: matrix.node != '16' || matrix.os != 'ubuntu-latest'
69-
uses: nick-invision/retry@v2
69+
if: matrix.node != '18' || matrix.os != 'ubuntu-latest'
70+
uses: nick-invision/retry@v3
7071
with:
7172
timeout_minutes: 20
7273
max_attempts: 3
7374
command: npm run test
7475

7576
- name: Run coverage
76-
if: matrix.node == '16' && matrix.os == 'ubuntu-latest'
77-
uses: nick-invision/retry@v2
77+
if: matrix.node == '18' && matrix.os == 'ubuntu-latest'
78+
uses: nick-invision/retry@v3
7879
with:
7980
timeout_minutes: 20
8081
max_attempts: 3
8182
command: npm run test:coverage
8283

8384
- name: ⬆️ Upload coverage to Codecov
84-
if: matrix.node == '16' && matrix.os == 'ubuntu-latest'
85-
uses: codecov/codecov-action@v3
85+
if: matrix.node == '18' && matrix.os == 'ubuntu-latest'
86+
uses: codecov/codecov-action@v5
8687
with:
8788
files: ./coverage/coverage-final.json
8889
name: codecov-prod
90+
token: ${{ secrets.CODECOV_TOKEN }}
8991

9092
release:
9193
if: ${{ github.repository == 'htmlhint/HTMLHint' &&
@@ -95,10 +97,10 @@ jobs:
9597
needs: build
9698
steps:
9799
- name: ⬇️ Checkout repo
98-
uses: actions/checkout@v3
100+
uses: actions/checkout@v4
99101

100102
- name: ⎔ Setup node
101-
uses: actions/setup-node@v3
103+
uses: actions/setup-node@v4
102104
with:
103105
cache: npm
104106

@@ -109,7 +111,7 @@ jobs:
109111
run: npm run build
110112

111113
- name: 🚢 Release
112-
uses: cycjimmy/semantic-release-action@v3
114+
uses: cycjimmy/semantic-release-action@v4
113115
with:
114116
extra_plugins: |
115117
@semantic-release/changelog

.github/workflows/sync-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- uses: micnncim/action-label-syncer@v1
1919
with:

.github/workflows/test-release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121

2222
steps:
2323
- name: ⬇️ Checkout repo
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- name: ⎔ Setup node
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2828
with:
2929
cache: npm
3030

@@ -35,7 +35,7 @@ jobs:
3535
run: npm run build
3636

3737
- name: 🚢 Release
38-
uses: cycjimmy/semantic-release-action@v3
38+
uses: cycjimmy/semantic-release-action@v4
3939
with:
4040
dry_run: true
4141
extra_plugins: |

.github/workflows/website.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: ⬇️ Checkout
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: ⎔ Setup node
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
with:
2525
cache: npm
2626
cache-dependency-path: website/package-lock.json

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
v18

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ $ ./node_modules/.bin/htmlhint www/index.html
5353
$ ./node_modules/.bin/htmlhint www/**/*.html
5454
```
5555

56+
Or, you can use HTMLHint linter programatically, like this:
57+
```
58+
import { HTMLHint } from 'htmlhint';
59+
const htmlVerificationHints = HTMLHint.verify(localHtmlContent);
60+
console.log('htmlVerificationHints', htmlVerificationHints); // this logs a list of `Hint`s which contain information on all linting errors
61+
```
62+
5663
### Global Installation and Usage
5764

5865
If you want to make HTMLHint available to tools that run across all of your projects, you can install HTMLHint globally using npm:

docs/user-guide/rules/spec-char-escape.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ Level: `error`
1212
1. true: enable rule
1313
2. false: disable rule
1414

15-
The following pattern are **not** considered violations:
15+
The following patterns are **not** considered violations:
1616

1717
<!-- prettier-ignore -->
1818
```html
1919
<span>aaa&gt;bbb&lt;ccc</span>
20+
<span>Steinway &amp; Sons, Q&amp;A</span>
21+
<span>Steinway & Sons, Q&A</span>
2022
```
2123

2224
The following pattern is considered violation:

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"url": "git+https://github.com/htmlhint/HTMLHint.git"
1818
},
1919
"engines": {
20-
"node": ">=14"
20+
"node": ">=18"
2121
},
2222
"license": "MIT",
2323
"main": "dist/htmlhint.js",

src/core/rules/spec-char-escape.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default {
66
init(parser, reporter) {
77
parser.addListener('text', (event) => {
88
const raw = event.raw
9-
// TODO: improve use-cases for &
10-
const reSpecChar = /([<>])|( \& )/g
9+
const reSpecChar = /([<>])/g
1110
let match
1211

1312
while ((match = reSpecChar.exec(raw))) {

test/rules/spec-char-escape.spec.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ describe(`Rules: ${ruleId}`, () => {
2121
expect(messages[2].col).toBe(4)
2222
})
2323

24-
it('Special characters: & should result in an error', () => {
25-
const code = '<p>Steinway & Sons</p>'
24+
it('Special characters: normal & should not result in an error', () => {
25+
const code = '<p>Steinway & Sons Q&A</p>'
2626
const messages = HTMLHint.verify(code, ruleOptions)
27-
expect(messages.length).toBe(1)
28-
expect(messages[0].rule.id).toBe(ruleId)
29-
expect(messages[0].line).toBe(1)
30-
expect(messages[0].col).toBe(12)
27+
expect(messages.length).toBe(0)
3128
})
3229

3330
it('Normal text should not result in an error', () => {

0 commit comments

Comments
 (0)