Add more rehype plugins

This commit is contained in:
pancakes 2024-04-24 20:01:55 +10:00
parent 0545a9dd99
commit 3f6267ea97
3 changed files with 20 additions and 0 deletions

17
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -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"
}]