Symbitic / remark-plugins

Remark plugins for Markbook
MIT License
14 stars 7 forks source link

fix(remark-deflist): <dl> should not be child of <p> #4

Closed simonflk closed 3 years ago

simonflk commented 4 years ago

This PR fixes #3

simonflk commented 4 years ago

For now, I am working around it with

  .use(deflist)
  .use(() => tree =>
    visit(tree, ["paragraph"], node => {
      // remove invalid <p> wrapper around <dl>
      // See https://github.com/Symbitic/remark-plugins/issues/3
      if (
        node.children.length === 1 &&
        node.children[0].type === "descriptionlist"
      ) {
        Object.assign(node, node.children[0]);
      }
    })
  )
Symbitic commented 3 years ago

Hi @simonflk, sorry for taking so long. Your pull request has been merged. Thank you for submitting this.