-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Customize Lexer and Parser #1890
Comments
If I understand correctly, #1872 only addresses the Lexer. With that merged, I would still be unable to create a custom renderer with the ability to pass around an additional argument for attributes, no? |
Ya the idea is that you will be able to create your own tokenizers and renderers so you will be able to pass whatever you want. I'm not exactly sure how it will work out. The current implementation is very slow. If you want to help out we could use more input on it. |
I took a closer look at #1872. I'm afraid I don't understand marked internals enough to make useful speed-up suggestions. Happy to help though if there's something less sophisticated to do. |
Describe the feature
Provide the ability to customize the Lexer and Parser.
Why is this feature necessary?
Marked's current architecture is not amenable to certain extensions. I'd like to create an extension that supports custom attributes (like remark-attr and markdown-it-attrs):
# Yeah{.success}
Currently, I can only customize the Tokenizer and Renderer. This means, the call signature for rendering e.g. a link is fixed by the Parser to be
link(href, title, text) { ... }
. This leaves no room for passing in another argumentattrs
to render any attributes.Describe alternatives you've considered
Nothing good comes to mind.
The text was updated successfully, but these errors were encountered: