diff --git a/CHANGELOG.md b/CHANGELOG.md index 171c66193..719a31b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # HEAD +- Changed: update to ``remark-autolink-headings@^4.0.0``. + This might fix issue with missing links for headings. - Changed: ``phenomic/lib/content-loader`` reference is deprecated in favor of ``import { phenomicLoader } from "phenomic"``. You can use ``phenomicLoader`` variable in webpack configuration to reference diff --git a/package.json b/package.json index 366a9a642..c67f1e39a 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "react-router-scroll": "^0.3.1", "redbox-react": "^1.2.2", "remark": "^5.0.0", - "remark-autolink-headings": "^3.0.0", + "remark-autolink-headings": "^4.0.0", "remark-highlight.js": "^4.0.0", "remark-html": "^5.0.0", "remark-slug": "^4.1.0", diff --git a/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/__tests__/index.js b/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/__tests__/index.js index fffa46d00..c3125df0d 100644 --- a/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/__tests__/index.js +++ b/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/__tests__/index.js @@ -10,7 +10,9 @@ test("should add raw property from content", (t) => { }, }), { - body: `

raw

\n`, + body: + "

#" + + "raw

\n", } ) }) diff --git a/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/index.js b/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/index.js index 8758b8462..5a8b63620 100644 --- a/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/index.js +++ b/src/phenomic-loader-plugin-markdown-transform-body-property-to-html/index.js @@ -13,10 +13,13 @@ function mdify(text) { // https://github.com/ben-eb/remark-autolink-headings .use(autoLinkHeadings, { - attributes: { - class: "phenomic-HeadingAnchor", + content: { + type: "text", + value: "#", + }, + linkProperties: { + className: "phenomic-HeadingAnchor", }, - template: "#", }) // https://github.com/wooorm/remark-html @@ -42,4 +45,3 @@ export default ( body: mdify(result.body), } } -