Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata to syntax highlighter #253

Closed
lucperkins opened this issue Dec 4, 2022 · 1 comment
Closed

Add metadata to syntax highlighter #253

lucperkins opened this issue Dec 4, 2022 · 1 comment

Comments

@lucperkins
Copy link
Contributor

lucperkins commented Dec 4, 2022

I'd like to use Comrak to create some custom Markdown extensions, including fancy code blocks along the lines of rehype-pretty-code. One barrier presented by the current implementation is that SyntaxHighlighterAdapter doesn't provide access to arbitrary metadata like this:

Here is some Rust code:

```rust filename="main.rs"
fn main() {}

Here, filename="main.rs" wouldn't be accessible to SyntaxHighlighterAdapter. Now, it is possible to access this in Comrak using the more manual method (iterating through the AST nodes) but I find SyntaxHighlighterAdapter much more ergonomic. Happy to help out with this, just wanted to see if others had run into this limitation.

@kivikakk
Copy link
Owner

kivikakk commented Mar 28, 2023

Per #257, #253 #276 hopefully now covers this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants