Skip to content

Esmodule version of the introduction of hast-util-from-dom leads to errors... #56

Closed
@rxliuli

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/rehype-mathjax/lib/renderer.js b/node_modules/rehype-mathjax/lib/renderer.js
index 1a6c927..a724d53 100644
--- a/node_modules/rehype-mathjax/lib/renderer.js
+++ b/node_modules/rehype-mathjax/lib/renderer.js
@@ -1,6 +1,6 @@
 const mathjax = require('mathjax-full/js/mathjax').mathjax
 const register = require('mathjax-full/js/handlers/html').RegisterHTMLHandler
-const fromDom = require('hast-util-from-dom')
+const fromDom = require('hast-util-from-dom').default
 const toText = require('hast-util-to-text')
 const createAdaptor = require('./adaptor')
 

This issue body was partially generated by patch-package.

image

repo: https://github.com/rxliuli/joplin-search-intergration/blob/ff95928d5e02823cb2738ef72d826196aea09ade/src/pages/options/pages/note/util/render.ts#L27

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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