feat: add meta prop to custom renderer props#448
Closed
sleitor wants to merge 1 commit intovercel:mainfrom
Closed
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Closing as duplicate of #447 which was opened moments earlier for the same feature. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #443
Summary
Exposes the code fence metastring as a
metaprop in custom renderer callbacks. Previously, custom renderers receivedcode,language, andisIncompletebut not the metastring (the text after the language identifier, e.g.```rust {1} title="foo"→meta = '{1} title="foo"').The metastring was already being extracted internally (for
startLineparsing) — this change simply forwards it to custom renderers.Changes
lib/plugin-types.ts: Addedmeta?: stringtoCustomRendererPropslib/components.tsx: Passmeta={metastring}to custom renderer componentTesting
Added tests verifying
metais passed when a metastring is present and isundefinedwhen absent.