From 95aa7ba7ff2bef6373ab8b9614afe7466d0b094f Mon Sep 17 00:00:00 2001 From: Takahashi Yuki Date: Sun, 18 Dec 2022 05:35:10 +0900 Subject: [PATCH] =?UTF-8?q?idPropertyName=E3=81=AE=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=80=A4=E3=82=92ariaLabelledby=E3=81=AB=E5=A4=89=E6=9B=B4=20(?= =?UTF-8?q?#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release-drafterの削除 * chore: node14を対象から削除 * fix: idPropertyNameの初期値をariaLabelledbyに変更 * 1.0.3 --- .github/release-drafter.yml | 24 ------------------------ .github/workflows/test.yml | 4 +++- README.md | 8 ++++---- package-lock.json | 4 ++-- package.json | 4 ++-- src/index.ts | 2 +- tests/fixtures/headingId/output.html | 6 +++--- 7 files changed, 15 insertions(+), 37 deletions(-) delete mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index d78e643..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - main - pull_request: - types: [opened, reopened, synchronize] - -permissions: - contents: read - -jobs: - update_release_draft: - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v5 - with: - config-name: release-drafter.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6721bf8..c6bb2cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [16.x, 18.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} @@ -24,3 +24,5 @@ jobs: run: npm run lint - name: Run unit tests run: npm test + - name: Run unit build + run: npm run test diff --git a/README.md b/README.md index 5c4da1e..effd070 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ npm i -D @hbsnow/rehype-sectionize ### Output ```html -
+

h1

-
+

h2

-
+

h3

@@ -43,7 +43,7 @@ npm i -D @hbsnow/rehype-sectionize | `properties` | `hastscript.Properties` | `{}` | Attributes assigned to section | | `enableRootSection` | `boolean` | `false` | Section to wrap all | | `rankPropertyName` | `string` | `dataHeadingRank` | Name of rank data attribute | -| `idPropertyName` | `string` | `dataHeadingId` | Name of id data attribute | +| `idPropertyName` | `string` | `ariaLabelledby` | Name of id data attribute | ## License diff --git a/package-lock.json b/package-lock.json index 21a3a13..320a73c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hbsnow/rehype-sectionize", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hbsnow/rehype-sectionize", - "version": "1.0.2", + "version": "1.0.3", "license": "MIT", "dependencies": { "hast-util-heading": "2.0.0", diff --git a/package.json b/package.json index bf2f1e5..5808672 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hbsnow/rehype-sectionize", - "version": "1.0.2", + "version": "1.0.3", "description": "rehype plugin that wraps section based on heading", "type": "module", "main": "dist/index.js", @@ -48,6 +48,6 @@ "hast-util-heading-rank": "2.1.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" } } diff --git a/src/index.ts b/src/index.ts index 51a9f98..b979f62 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,7 +16,7 @@ const defaultOptions: Required = { properties: {}, enableRootSection: false, rankPropertyName: "dataHeadingRank", - idPropertyName: "dataHeadingId", + idPropertyName: "ariaLabelledby", }; const wrappingRank = ( diff --git a/tests/fixtures/headingId/output.html b/tests/fixtures/headingId/output.html index c6eae1e..f113121 100644 --- a/tests/fixtures/headingId/output.html +++ b/tests/fixtures/headingId/output.html @@ -1,8 +1,8 @@ -
+

h1

-
+

h2

-
+

h3