mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
fix(v2): fix empty link error message (#3435)
* fix empty link error message * fix snapshot
This commit is contained in:
parent
37989a00c3
commit
7ffe93903c
2 changed files with 8 additions and 2 deletions
|
@ -119,10 +119,16 @@ async function convertToAssetLinkIfNeeded({
|
|||
|
||||
async function processLinkNode({node, index, parent, filePath, staticDir}) {
|
||||
if (!node.url) {
|
||||
// try to improve error feedback
|
||||
// see https://github.com/facebook/docusaurus/issues/3309#issuecomment-690371675
|
||||
const title =
|
||||
node.title || (node.children[0] && node.children[0].value) || '?';
|
||||
const line =
|
||||
(node.position && node.position.start && node.position.start.line) || '?';
|
||||
throw new Error(
|
||||
`Markdown link url is mandatory. filePath=${toRelativePath(
|
||||
filePath,
|
||||
)}, title=${node.title}`,
|
||||
)}, title=${title}, line=${line}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue