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
i need to call my transform function on the parsed tokens array -
and then call the render function.
so would be super nice to be able to just insert async transformative calls between the two tasks..
something like:
consttokens=md.parse(your_source_md,env);// run async function with only side-effects on tokensawaitcallAsyncFN(tokens,idx,options,env,sefl);returnmd.renderer.render(tokens,md.options,env);
as fare as i can tell this would also mean an addition to the markdown-it-async wrapper.
(as there is only the full render call available at this..)
// .../** * Custom tranformations apply before and after the markdown transformation */
transforms?: {before?: (code: string,id: string)=>string|Promise<string>renderingAfterParsingBeforeRender?: (tokens: array,idx: number,options: object,env: object,self:MarkdownIt)=>None|Promise<none>after?: (code: string,id: string)=>string|Promise<string>/** * Return extra code to be injected into the `<script>` tag */extraScripts?: (frontmatter: Record<string,any>,id: string)=>string[]|Promise<string[]>}// ...
Alternative
No response
Additional context
i will try and create some sort of minimal example in the next days
Clear and concise description of the problem
i would like to embed code from files into
fenced
blocks:for this i need some async action:
markdown-it/markdown-it#256 (comment)
i need to call my transform function on the parsed tokens array -
and then call the render function.
so would be super nice to be able to just insert async transformative calls between the two tasks..
something like:
as fare as i can tell this would also mean an addition to the markdown-it-async wrapper.
(as there is only the full
render
call available at this..)Suggested solution
add option similar to this
types.ts
Alternative
No response
Additional context
i will try and create some sort of minimal example in the next days
for a complex test-setup you can have a look at
https://github.com/s-light/quasar-unplugin-vue-markdown-tests
https://codesandbox.io/p/github/s-light/quasar-unplugin-vue-markdown-tests/
Validations
The text was updated successfully, but these errors were encountered: