Skip to content

consult how to use token like js markdown-it in markdown-it-rust #42

Open
@Maidang1

Description

@Maidang1

The project is really awesome! I'm going to implement @mdit-vue/plugin-component into Rust. When I checked the source code of @mdit-vue/plugin-component, I found some code as follows.
https://github.com/mdit-vue/mdit-vue/blob/main/packages/plugin-component/src/html-block-rule.ts#L111

   let token = state.push('html_inline', '', 0);
   token.content = match[0];
   token.map = [startLine, state.line];
   // treat the following content as `inline` token to be parsed by other inline rules
   token = state.push('inline', '', 0);
   token.content = lineText.slice(match[0].length);
   token.map = [startLine, state.line];
   token.children = [];

I'm confused about how to use the token in markdown-it-rust. Could you please give me a hand?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions