onBrokenMarkdownLinks errors for invalid links inside tilde codeblocks only
See original GitHub issueHave you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Docusaurus checks for broken links inside tilde code blocks when onBrokenMarkdownLinks
is set to throw
Reproducible demo
No response
Steps to reproduce
- create a new docusaurus site using
create-docusaurus
- make sure that docusaurus.config.js contains
onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'throw',
- Add following content to
docs/intro.md
``` this is an [invalid link](./path/to/a/page/that/does/not/exist.md) ```
- run
npx docusaurus build
to see the site build as expected - change the codeblock from step 3 to use ~ instead of ` ie
~~~ this is an [invalid link](./path/to/a/page/that/does/not/exist.md) ~~~
- run
npx docusaurus build
to see the build fail with an errorError: Docs markdown link couldn't be resolved: (./path/to/a/page/that/does/not/exist.md) in "/Users/foo/bar/baz/docusaurus/packages/testsite/docs/intro.md" for version current at Array.forEach (<anonymous>)
Expected behavior
Docusaurus either does not check links inside codeblock or checks them for both backtick and tilde codeblocks when onBrokenMarkdownLinks
is set to throw
Actual behavior
Docusaurus errors for broken markdown links only inside tilde codeblocks when onBrokenMarkdownLinks
is set to throw
Your environment
- Public source code: NA
- Public site URL: NA
- Docusaurus version used: Can reproduce with 2.0.0-beta.21 and 2.0.0-rc.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 16.4
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Macos
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
onBrokenMarkdownLinks errors for invalid links inside tilde ...
[ ] I have read the console error message carefully (if applicable). Description. Docusaurus checks for broken links inside tilde code blocks when ......
Read more >onBrokenMarkdownImagePaths to catch bad paths without ...
When I first saw the error, I immediately set onBrokenMarkdownLinks to "warn" thinking that it would allow the build to continue (I could...
Read more >I keep on getting this error
I've just started with C++ and Code::Blocks and I've done what every noob does, the "Hello World! ... mingw32-make.exe: invalid option -- g...
Read more >Fenced Code Blocks — Python-Markdown 3.4.1 documentation
To include a set of backticks (or tildes) within a code block, use a different number ... Fenced Code Blocks are only supported...
Read more >Implement ```-style (fenced) Markdown code blocks
Code fences work now. · A code fence consists of three or more backticks ``` or tildes ~~~ , indented by zero to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In that case I would personally use four backticks…
@antonk52 Thanks for reporting! #7801 should fix this. You can watch out for the next canary (should be in a few minutes) and give it a try.