fix(content): failed ci on windows and enhance file name detection regex #680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of changes
Description
This PR do 2 things:
Last time we added custom highlighter, the test case always make the CI failed on Windows. After long debugging, I found that the culprit was shiki twoslash always renders a custom link to TypeScript playground for each code block. I don't know why the custom link is generated a little bit random although the code isn't changed in Windows. It doesn't work that way in Linux or Windows, the link will always be same. That's why the CI isn't failed in Linux and Mac. So I decided to remove that link to make the test case worked.
To give more context @benjamincanac and I already discussed here #467 .
Using previous method, this code won't parsed correctly:
By default we already parsed language, line highlight and file name. And actually we can still add our custom data/identifier there. In new custom highlighter syntax we can get that value through
node
:Checklist: