Skip to content

Commit dad194a

Browse files
committed
Fix link generation for Lezer exports in generated readme files
1 parent 74e8431 commit dad194a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/build-readme.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ exports.buildReadme = function(pkg) {
1111
let sibling = type.typeSource && core.find(name => type.typeSource.startsWith("../" + name + "/"))
1212
if (sibling) return "https://codemirror.net/docs/ref#" + sibling + "." + type.type
1313
}, type => {
14-
if (/\blezer[\/-]tree\b/.test(type.typeSource)) return `https://lezer.codemirror.net/docs/ref/#tree.${type.type}`
15-
if (/\blezer\b/.test(type.typeSource)) return `https://lezer.codemirror.net/docs/ref/#lezer.${type.type}`
14+
if (/\blezer\/tree\b/.test(type.typeSource)) return `https://lezer.codemirror.net/docs/ref/#tree.${type.type}`
15+
if (/\blezer\/common\b/.test(type.typeSource)) return `https://lezer.codemirror.net/docs/ref/#common.${type.type}`
16+
if (/\blezer\/lr\b/.test(type.typeSource)) return `https://lezer.codemirror.net/docs/ref/#lr.${type.type}`
17+
if (/\blezer\/markdown\b/.test(type.typeSource)) return `https://github.com/lezer-parser/markdown#user-content-${type.type.toLowerCase()}`
1618
if (/\bstyle-mod\b/.test(type.typeSource)) return "https://github.com/marijnh/style-mod#documentation"
1719
}, browserImports]
1820

0 commit comments

Comments
 (0)