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

fix(gatsby-transformer-remark): fix plugin conflict causing escaped HTML in headings #20024

Merged
merged 2 commits into from Dec 16, 2019

Commits on Dec 13, 2019

  1. Fix plugin conflict causing escaped HTML in headings

     * The `gatsby-remark-prismjs` plugin was causing HTML code to be escaped and rendered as text in TOC entries generated by `gatsby-transformer-remark`.  It generated HTML nodes which the `mdast-util-toc` module flattened into text.  This was fixed upstream in a major version bump.
     * Update the version of `mdast-util-toc` used in `gatsby-transformer-remark` to the latest version in order to fix the issue
      * Set `{ allowDangerousHTML: true }` on calls to `hastToHTML()` and `toHAST()` when building the TOC.  This is required in order to properly render the embedded HTML nodes.
     * Bump `mdast-util-to-hast` to its latest version as well
      * Update one snapshot test that was very slightly broken as a result of this
     * Slight refactor of code in `on-node-create.js` to reduce nesting and clean up control flow
     * Add two snapshot tests to verify that the fix was successful
    Ameobea committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    9ac63d7 View commit details
    Browse the repository at this point in the history
  2. Un-bump mdast-util-to-hast

     * This bump caused a small regression in one of the tests which was deemed unacceptable.  This reverts it to its previous version and restores the original test behavior.
      * Revert the updated snapshot test as well
     * Undo refactoring changes in `extend-node-type.js` in order to produce a cleaner diff for the PR
    Ameobea committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    1302d3f View commit details
    Browse the repository at this point in the history