question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Options are not passed to mdast-util-to-hast

See original GitHub issue

Initial checklist

Affected packages and versions

^9.1.0

Link to runnable example

https://codesandbox.io/s/remark-rehype-debug-4cz8v?file=/src/index.js:488-532

Steps to reproduce

Pass a custom handler and see that it’s not used

function link(h, node) {
    return h(node, 'a', {href: "/abc"}, [])
}

.use(remarkRehype, null, {handlers: {link}})

Expected behavior

Custom link handler should override default one

Actual behavior

Passed handlers are ignored

Runtime

Node v16

Package manager

npm v6

OS

Linux

Build and bundle tools

Webpack

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
SunPjcommented, Oct 4, 2021

Thanks @wooorm

1reaction
wooormcommented, Oct 3, 2021

I just added support for an explicit destination: null to solve your expectation!

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm:mdast-util-to-hast | Skypack
Helper function for writing custom handlers passed to options.handlers . Pass it h and a parent node (mdast) and it will turn the...
Read more >
Is there any way to detect whether an option was passed as a ...
I was thinking to check the parsed arguments against the default arguments, but then the user would not be able to override a...
Read more >
shell script - How do I make an option (not argument of the ...
Here the argument of the option is mandatory so I am getting this error. How can I make the option mandatory so that...
Read more >
Extend Markdown Parser To Render Custom Code Blocks
While not enabling all markdown extensions e.g. tables custom linebreak behaviour ... All options except for sanitize and handlers are passed to hastutil....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found