WIP: Parsing obsidian image link

This commit is contained in:
Tuan Cao 2022-04-28 16:44:59 +07:00
parent 47d0eb25ba
commit ba519d7e28
3 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import {Node} from "./node";
import rehypePrism from 'rehype-prism-plus' import rehypePrism from 'rehype-prism-plus'
import remarkRehype from 'remark-rehype' import remarkRehype from 'remark-rehype'
import rehypeStringify from 'rehype-stringify' import rehypeStringify from 'rehype-stringify'
import obsidianImage from './obsidian-image.js'
import {getAllMarkdownFiles, toFilePath, toSlug} from "./utils"; import {getAllMarkdownFiles, toFilePath, toSlug} from "./utils";
export const Transformer = { export const Transformer = {
@ -62,7 +62,8 @@ export const Transformer = {
unified() unified()
.use(markdown, {gfm: true}) .use(markdown, {gfm: true})
.use(highlight) .use(obsidianImage)
.use(highlight)
.use(externalLinks, {target: "_blank", rel: ['noopener']}) .use(externalLinks, {target: "_blank", rel: ['noopener']})
.use(frontmatter, ['yaml', 'toml']) .use(frontmatter, ['yaml', 'toml'])
.use(wikiLinkPlugin, { .use(wikiLinkPlugin, {

View File

@ -44,6 +44,7 @@
"remark-wiki-link": "^1.0.0", "remark-wiki-link": "^1.0.0",
"to-vfile": "^6.1.0", "to-vfile": "^6.1.0",
"unified": "^9.2.0", "unified": "^9.2.0",
"unist-util-visit": "^4.1.0",
"vfile-reporter": "^6.0.1" "vfile-reporter": "^6.0.1"
}, },
"devDependencies": { "devDependencies": {

View File

@ -4329,7 +4329,7 @@ unist-util-visit@^3.0.0:
unist-util-is "^5.0.0" unist-util-is "^5.0.0"
unist-util-visit-parents "^4.0.0" unist-util-visit-parents "^4.0.0"
unist-util-visit@^4.0.0: unist-util-visit@^4.0.0, unist-util-visit@^4.1.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.0.tgz#f41e407a9e94da31594e6b1c9811c51ab0b3d8f5" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.0.tgz#f41e407a9e94da31594e6b1c9811c51ab0b3d8f5"
integrity sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ== integrity sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ==