vscode-markdown-preview-enhanced
vscode-markdown-preview-enhanced copied to clipboard
“Extend Markdown Parser” not working any more
Describe the bug Up to version v0.6.10, any code in the "parser.js" file before the line "module.exports = {" did work. In particular, I need external modules that I could load with "require" up to v0.6.10. Example: "const XRegExp = require('./xregexp-all.js');" did work. How can I use "require" to load modules in the "parser.js" file with the current version v0.8.10? This is definitely needed for more demanding tasks. Is there a solution for this?
Environment
- OS: MacOS 14.1.1
- VSCode: 1.84.2
- Markdown Preview Enhanced: 0.8.10
To Reproduce Steps to reproduce the behavior:
- Open file "parser.js"
- Add any valid "require" on top (Example for a module that has been installed with this path: "const XRegExp = require('./xregexp-all.js');").
- Restart VSC, open a *.md file, nothing works, if you remove the Test-Line you have to restart VSC, otherwise Markdown Preview enhanced won't work again.
- It looks like any code within the "parser.js" file before the first line starting with "({" does not work any more. A solution is needed to use "require" within the "parser.js" file.
Expected behavior Any code at the beginning of the "parser.js" file should work, especially "require". Otherwise a solution is needed to import modules for usage within the "parser.js"
Markdown file any, it does not depend on the content, it is about the usage of "require" within the "parser.js" file.
Screenshots none
Additional context none
We will consider bringing it back in the future. Right now to support the extension in the browser, require
is disabled and all javascript code is run in the sandbox now.