Closed vnphanquang closed 4 months ago
Latest commit: 939981d07051b96ba28846058f34ee99d4ba55fd
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Ran prettier
just now, amended to existing commit. Sorry for not doing that earlier.
Sorry for the delay! Released now https://github.com/pngwn/MDsveX/releases/tag/mdsvex%400.11.1
Sorry for the delay! Released now https://github.com/pngwn/MDsveX/releases/tag/mdsvex%400.11.1
Thanks 🎉. No worries at all
Context
Today, as of mdsvex@0.11.0, a custom highlighter function is not aware of the filename of the file being processed by MDsveX, and there is no way (that i am aware of) to get around this using the public API.
This issue adds such support by passing additional
filename
positional param for highlighter.Rationale
Having
filename
in highlighter will allow more complex customization. Specifically, I'm trying to have the syntax highlighter read the source code from file system provided in a meta line, something like this:This allows keeping certain example source code in a separate file, making better use of editor support, enabling reusability of said source code, and keeping the MDsveX file succinct.