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
Register Walktokens Behavior for extensions with different token structure #3170
Comments
You can use |
LMAO. Did I put that there way back in the original Extensions package at #2043? Wow. Yep, it was there from the start. It's been way too long. .....nevermind..... |
Ah, wait. There is still the case of multiple rows in the table. I can list We don't currently handle the case where you pass |
Right. That should be easy to handle just flatten childTokens array. |
Describe the feature
In
walkTokens()
, traversing child tokens has to be handled differently fortable
s andlist
s, due to not holding a standardtokens
object.https://github.com/markedjs/marked/blob/6f4467ca9762f3a502c400ddc7687a27985f050d/src/Instance.ts#L44C7-L61
I have recently noticed that my extension marked-extended-tables fails to be walked correctly, since it has nearly the same structure as
table
but a different token typespanTable
. I would like some way to register the expected walk path for extensions that do not have the standardtokens
object.Why is this feature necessary?
For compatibility with other extensions that use
walkTokens()
, because child tokens ofmarked-extended-table
are not properly traversed.Describe alternatives you've considered
Some kind of "on-the-fly" changing of the
spanTable
type back and forth betweentable
andspanTable
so it can still land in the correctspanTable
Renderer, but this also fails due to slight differences in my token (spanTable
supports multiple header rows for example).The text was updated successfully, but these errors were encountered: