Skip to content
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

Format not well when convert checked list #21

Open
thunderfalco opened this issue Jun 25, 2024 · 3 comments
Open

Format not well when convert checked list #21

thunderfalco opened this issue Jun 25, 2024 · 3 comments

Comments

@thunderfalco
Copy link

origin html:

<ul data-type="taskList">
    <li data-checked="false" data-type="taskItem">
        <label>
            <input type="checkbox">
            <span></span>
       </label>
       <div><p>question</p></div>
    </li>
</ul>

result:
image

@thunderfalco
Copy link
Author

image
  • [ ]

    question

@jaywcjlove
Copy link
Owner

@thunderfalco This requires adding rehypePlugins/remarkPlugins separately, as this is not standard checked list HTML.

<ul>
 <li><input type="checkbox"> question</li>
</ul>

jaywcjlove added a commit that referenced this issue Jun 26, 2024
jaywcjlove added a commit that referenced this issue Jun 26, 2024
@jaywcjlove
Copy link
Owner

@thunderfalco

if (node.type === "element" && node.tagName === "li") {
let code = getCodeString(node.children)
node.children = [
{
type: "element",
tagName: "input",
properties: {
type: "checkbox",
checked: false
}
},
{
type: "text",
value: code
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants