From 3f6267ea971cc2e22dbc1b32bfc80dc6e1b46af6 Mon Sep 17 00:00:00 2001 From: pancakes Date: Wed, 24 Apr 2024 20:01:55 +1000 Subject: [PATCH] Add more rehype plugins --- package-lock.json | 17 +++++++++++++++++ package.json | 1 + svelte.config.js | 2 ++ 3 files changed, 20 insertions(+) diff --git a/package-lock.json b/package-lock.json index e1b6e3f..10ecac3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "eslint": "^8.56.0", "eslint-plugin-svelte": "^2.35.1", "mdsvex": "^0.11.0", + "rehype-attr": "^3.0.3", "rehype-external-links": "^3.0.0", "remark-emoji": "^4.0.1", "remark-gfm": "^4.0.0", @@ -2982,6 +2983,22 @@ "node": ">=8.10.0" } }, + "node_modules/rehype-attr": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/rehype-attr/-/rehype-attr-3.0.3.tgz", + "integrity": "sha512-Up50Xfra8tyxnkJdCzLBIBtxOcB2M1xdeKe1324U06RAvSjYm7ULSeoM+b/nYPQPVd7jsXJ9+39IG1WAJPXONw==", + "dev": true, + "dependencies": { + "unified": "~11.0.0", + "unist-util-visit": "~5.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + } + }, "node_modules/rehype-external-links": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/rehype-external-links/-/rehype-external-links-3.0.0.tgz", diff --git a/package.json b/package.json index b3589c8..f6f239e 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "eslint": "^8.56.0", "eslint-plugin-svelte": "^2.35.1", "mdsvex": "^0.11.0", + "rehype-attr": "^3.0.3", "rehype-external-links": "^3.0.0", "remark-emoji": "^4.0.1", "remark-gfm": "^4.0.0", diff --git a/svelte.config.js b/svelte.config.js index d3196c5..05da754 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,7 @@ import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import { mdsvex } from "mdsvex"; +import attr from "rehype-attr"; import emoji from "remark-emoji"; import gfm from "remark-gfm"; import rehypeExternalLinks from "rehype-external-links"; @@ -28,6 +29,7 @@ export default { gfm ], rehypePlugins: [ + [attr, { properties: 'attr' }], [rehypeExternalLinks, { target: "_blank" }]