Skip to content

Commit ec075a6

Browse files
committed
Patch wikilink plugin
datopian/portaljs#1342
1 parent 0a2825e commit ec075a6

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,10 @@
3232
"typescript": "5.7.2",
3333
"zod": "^3.24.1"
3434
},
35-
"packageManager": "[email protected]+sha256.9e534e70afef06374f6126b44bda5760947135ce16a30aef1010e965fb7e3e3e"
35+
"packageManager": "[email protected]+sha256.9e534e70afef06374f6126b44bda5760947135ce16a30aef1010e965fb7e3e3e",
36+
"pnpm": {
37+
"patchedDependencies": {
38+
"@portaljs/remark-wiki-link": "patches/@portaljs__remark-wiki-link.patch"
39+
}
40+
}
3641
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/dist/index.cjs b/dist/index.cjs
2+
index 80d21bbf699310538dbb0a5c1b063b0716706fc4..53f8dab5fc21920fe90891260c672902f91573c8 100644
3+
--- a/dist/index.cjs
4+
+++ b/dist/index.cjs
5+
@@ -366,11 +366,12 @@ function fromMarkdown() {
6+
current.data.alias = alias;
7+
}
8+
function exitWikiLink(token) {
9+
- var wikiLink = this.exit(token);
10+
+ var wikiLink = top(this.stack);
11+
var _wikiLink$data = wikiLink.data,
12+
isEmbed = _wikiLink$data.isEmbed,
13+
target = _wikiLink$data.target,
14+
alias = _wikiLink$data.alias;
15+
+ this.exit(token);
16+
// eslint-disable-next-line no-useless-escape
17+
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])*)?$/;
18+
var _target$match = target.match(wikiLinkWithHeadingPattern),
19+
diff --git a/dist/index.js b/dist/index.js
20+
index 8cee892269bb0768d9be4f3f6407a59e3b56af40..680381cfac8489242cafb577f2044507004398fb 100644
21+
--- a/dist/index.js
22+
+++ b/dist/index.js
23+
@@ -357,11 +357,12 @@ function fromMarkdown() {
24+
current.data.alias = alias;
25+
}
26+
function exitWikiLink(token) {
27+
- var wikiLink = this.exit(token);
28+
+ var wikiLink = top(this.stack);
29+
var _wikiLink$data = wikiLink.data,
30+
isEmbed = _wikiLink$data.isEmbed,
31+
target = _wikiLink$data.target,
32+
alias = _wikiLink$data.alias;
33+
+ this.exit(token);
34+
// eslint-disable-next-line no-useless-escape
35+
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])*)?$/;
36+
var _target$match = target.match(wikiLinkWithHeadingPattern),

pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/blog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const fetchBlogPosts = cache(async () => {
8484
).then((results) =>
8585
results.flatMap((res) => {
8686
if (res.status === 'fulfilled') return [res.value]
87-
console.warn(res.reason)
87+
// console.warn(res.reason)
8888
return []
8989
}),
9090
)

0 commit comments

Comments
 (0)