feat(markdown): include all regions with same name #5014
+234
−132
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.
Description
VitePress supports including a part of a file through a VS Code region. However, when multiple regions have the same name, only one is included.
The workaround plugin suggested in #3690 is no longer maintained. 1 Furthermore, it suffers from a memory leak causing huge RAM usage. 2
While we at Fabric Docs have forked the plugin 3 to fix some issues, it still feels fragile.
Another problem is having to use two different syntaxes (
<<<vs@[]()) for including files, which caused confusion.Since this feature has been requested by VitePress directly, I don't think there's any point in trying to fix the plugin any further.
Linked Issues
fix #3690
Additional Context
Footnotes
https://github.com/fabioaanthony/markdown-it-vuepress-code-snippet-enhanced/issues/7 ↩
https://discord.com/channels/507304429255393322/1208846408552030238/1407245292482330695 via https://discord.gg/v6v4pMv ↩
https://github.com/IMB11/md-it-enhanced-snippets ↩