Skip to content

Commit

Permalink
Patch wikilink plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
GRA0007 committed Dec 27, 2024
1 parent 0a2825e commit ec075a6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"typescript": "5.7.2",
"zod": "^3.24.1"
},
"packageManager": "[email protected]+sha256.9e534e70afef06374f6126b44bda5760947135ce16a30aef1010e965fb7e3e3e"
"packageManager": "[email protected]+sha256.9e534e70afef06374f6126b44bda5760947135ce16a30aef1010e965fb7e3e3e",
"pnpm": {
"patchedDependencies": {
"@portaljs/remark-wiki-link": "patches/@portaljs__remark-wiki-link.patch"
}
}
}
36 changes: 36 additions & 0 deletions patches/@portaljs__remark-wiki-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/dist/index.cjs b/dist/index.cjs
index 80d21bbf699310538dbb0a5c1b063b0716706fc4..53f8dab5fc21920fe90891260c672902f91573c8 100644
--- a/dist/index.cjs
+++ b/dist/index.cjs
@@ -366,11 +366,12 @@ function fromMarkdown() {
current.data.alias = alias;
}
function exitWikiLink(token) {
- var wikiLink = this.exit(token);
+ var wikiLink = top(this.stack);
var _wikiLink$data = wikiLink.data,
isEmbed = _wikiLink$data.isEmbed,
target = _wikiLink$data.target,
alias = _wikiLink$data.alias;
+ this.exit(token);
// eslint-disable-next-line no-useless-escape
var wikiLinkWithHeadingPattern = /^((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/;
var _target$match = target.match(wikiLinkWithHeadingPattern),
diff --git a/dist/index.js b/dist/index.js
index 8cee892269bb0768d9be4f3f6407a59e3b56af40..680381cfac8489242cafb577f2044507004398fb 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -357,11 +357,12 @@ function fromMarkdown() {
current.data.alias = alias;
}
function exitWikiLink(token) {
- var wikiLink = this.exit(token);
+ var wikiLink = top(this.stack);
var _wikiLink$data = wikiLink.data,
isEmbed = _wikiLink$data.isEmbed,
target = _wikiLink$data.target,
alias = _wikiLink$data.alias;
+ this.exit(token);
// eslint-disable-next-line no-useless-escape
var wikiLinkWithHeadingPattern = /^((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/;
var _target$match = target.match(wikiLinkWithHeadingPattern),
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion utils/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const fetchBlogPosts = cache(async () => {
).then((results) =>
results.flatMap((res) => {
if (res.status === 'fulfilled') return [res.value]
console.warn(res.reason)
// console.warn(res.reason)
return []
}),
)
Expand Down

0 comments on commit ec075a6

Please sign in to comment.