You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for delete the issue template since it seems no a suitable place to put in.
Currently, we are doing the v13 adaption from v12.0.2 to v13.0.2.
AFAK, in the v13 changes the renderer to pass the Token directly.
Hence there is no sweet default rendered result to use now. such as the list.
Before the v13, we could use the body directly and it already resolved the list items.
(renderer.list=(body,ordered,start)=>{// body with resolved list items}
But now, it only has the raw content and we have to render the list items in the renderer.list manually, although it is literally the same behavior as the default renderer.
(renderer.list=function(token){constordered=token.ordered;conststart=token.start;// manually get the body nowletbody='';for(letj=0;j<token.items.length;j++){constitem=token.items[j];body+=this.listitem?.(item);}// now , the body is backif(.../.test(body)){}
I found there has a useNewRenderer config for compatibility but it seems gonna be removed in #3342
Is there other way to gain the body same to the versions before v13 without copying the default renderer behaviors?
Thx a lot!
The text was updated successfully, but these errors were encountered:
Koooooo-7
changed the title
How to use the out of box rendered result of pre-version on v13.
How to use the out of box rendered result of pre versions on v13.
Jul 18, 2024
In v13 we moved the logic to render the body from the parser to the renderer functions so users have more control over what data is received in the renderers.
The new renderer style is an opt-in so extensions have time to update. In v14 the old renderers will be removed completely.
In v13 we moved the logic to render the body from the parser to the renderer functions so users have more control over what data is received in the renderers.
The new renderer style is an opt-in so extensions have time to update. In v14 the old renderers will be removed completely.
I see.
So in v13+, it gonna bring more flexibilities to let user fully controls the Tokens as a pure Visitor and remove the old renderers. If I wanna the behavior (output) align to old versions, I do need do the implementation by myself in v13 and further versions.
Btw, the old renderer functions act as post processor is useful tho.
Currently, we are doing the v13 adaption from v12.0.2 to v13.0.2.
AFAK, in the v13 changes the renderer to pass the
Token
directly.Hence there is no sweet default rendered result to use now. such as the
list
.Before the v13, we could use the
body
directly and it already resolved the list items.But now, it only has the
raw
content and we have to render thelist items
in therenderer.list
manually, although it is literally the same behavior as the default renderer.I found there has a
useNewRenderer
config for compatibility but it seems gonna be removed in #3342Is there other way to gain the
body
same to the versions before v13 without copying the default renderer behaviors?Thx a lot!
The text was updated successfully, but these errors were encountered: