rehype-header-linksを追加
This commit is contained in:
parent
94f40c51e0
commit
18a08efa6a
4 changed files with 7 additions and 1 deletions
3
bun.lock
3
bun.lock
|
@ -4,6 +4,7 @@
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@twemoji/parser": "^15.1.1",
|
"@twemoji/parser": "^15.1.1",
|
||||||
|
"rehype-header-links": "git+https://git.moris.day/moris/rehype-header-links.git",
|
||||||
"github-slugger": "^2.0.0",
|
"github-slugger": "^2.0.0",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"rehype-external-links": "^3.0.0",
|
"rehype-external-links": "^3.0.0",
|
||||||
|
@ -387,6 +388,8 @@
|
||||||
|
|
||||||
"rehype-github-alert": ["rehype-github-alert@1.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-whitespace": "^3.0.0", "unist-util-visit": "^5.0.0" } }, "sha512-Ijn6RGfqQTcqEvB4C7qfpk85NhVA7tncuUH8sncM45xrtuvlEt3Z9OHwoCZ8a/8wpXwfBDn9xorCVihLHg2O1w=="],
|
"rehype-github-alert": ["rehype-github-alert@1.0.0", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-whitespace": "^3.0.0", "unist-util-visit": "^5.0.0" } }, "sha512-Ijn6RGfqQTcqEvB4C7qfpk85NhVA7tncuUH8sncM45xrtuvlEt3Z9OHwoCZ8a/8wpXwfBDn9xorCVihLHg2O1w=="],
|
||||||
|
|
||||||
|
"rehype-header-links": ["rehype-header-links@git+https://git.moris.day/moris/rehype-header-links.git#18d1c952950c9ad87746e227aeeb670dae2a09c1", { "dependencies": { "@types/hast": "^3.0", "unist-util-visit-parents": "^6.0" }, "peerDependencies": { "typescript": "^5" } }, "18d1c952950c9ad87746e227aeeb670dae2a09c1"],
|
||||||
|
|
||||||
"rehype-highlight": ["rehype-highlight@7.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-text": "^4.0.0", "lowlight": "^3.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-dB/vVGFsbm7xPglqnYbg0ABg6rAuIWKycTvuXaOO27SgLoOFNoTlniTBtAxp3n5ZyMioW1a3KwiNqgjkb6Skjg=="],
|
"rehype-highlight": ["rehype-highlight@7.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-to-text": "^4.0.0", "lowlight": "^3.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-dB/vVGFsbm7xPglqnYbg0ABg6rAuIWKycTvuXaOO27SgLoOFNoTlniTBtAxp3n5ZyMioW1a3KwiNqgjkb6Skjg=="],
|
||||||
|
|
||||||
"rehype-katex": ["rehype-katex@7.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/katex": "^0.16.0", "hast-util-from-html-isomorphic": "^2.0.0", "hast-util-to-text": "^4.0.0", "katex": "^0.16.0", "unist-util-visit-parents": "^6.0.0", "vfile": "^6.0.0" } }, "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA=="],
|
"rehype-katex": ["rehype-katex@7.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/katex": "^0.16.0", "hast-util-from-html-isomorphic": "^2.0.0", "hast-util-to-text": "^4.0.0", "katex": "^0.16.0", "unist-util-visit-parents": "^6.0.0", "vfile": "^6.0.0" } }, "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA=="],
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
"rehype-external-links": "^3.0.0",
|
"rehype-external-links": "^3.0.0",
|
||||||
"rehype-github-alert": "^1.0.0",
|
"rehype-github-alert": "^1.0.0",
|
||||||
|
"rehype-header-links": "git+https://git.moris.day/moris/rehype-header-links.git",
|
||||||
"rehype-highlight": "^7.0.1",
|
"rehype-highlight": "^7.0.1",
|
||||||
"rehype-katex": "^7.0.1",
|
"rehype-katex": "^7.0.1",
|
||||||
"rehype-slug": "^6.0.0",
|
"rehype-slug": "^6.0.0",
|
||||||
|
|
|
@ -245,7 +245,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .marker {
|
& .marker a{
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
text-decoration-thickness: 1.125em;
|
text-decoration-thickness: 1.125em;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import rehypeHighlight from 'rehype-highlight'
|
||||||
import rehypeExternalLinks from 'rehype-external-links'
|
import rehypeExternalLinks from 'rehype-external-links'
|
||||||
import rehypeGithubAlert from 'rehype-github-alert'
|
import rehypeGithubAlert from 'rehype-github-alert'
|
||||||
import rehypeStringify from 'rehype-stringify'
|
import rehypeStringify from 'rehype-stringify'
|
||||||
|
import rehypeHeaderLinks from 'rehype-header-links'
|
||||||
|
|
||||||
|
|
||||||
function Perser(mdtext: string): string {
|
function Perser(mdtext: string): string {
|
||||||
|
@ -24,6 +25,7 @@ function Perser(mdtext: string): string {
|
||||||
.use(rehypeHighlight) // Syntax highlight
|
.use(rehypeHighlight) // Syntax highlight
|
||||||
.use(rehypeExternalLinks, {target:'_blank', rel:['noreferrer','noopener']}) // 外部サイトを新規タブで開く
|
.use(rehypeExternalLinks, {target:'_blank', rel:['noreferrer','noopener']}) // 外部サイトを新規タブで開く
|
||||||
.use(rehypeGithubAlert)
|
.use(rehypeGithubAlert)
|
||||||
|
.use(rehypeHeaderLinks, {style: {color:'inherit'}})
|
||||||
.use(rehypeStringify, {allowDangerousHtml: true})
|
.use(rehypeStringify, {allowDangerousHtml: true})
|
||||||
.processSync(mdtext)
|
.processSync(mdtext)
|
||||||
.toString()
|
.toString()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue