Closed danielepolencic closed 5 years ago
@danielepolencic those are internal APIs.
If you want to use them, do so at the risk of them not being covered by semantic versioning. If you still want to use them, they can be accessed with:
const all = require('mdast-util-to-hast/lib/all');
const one = require('mdast-util-to-hast/lib/one');
Thanks. I tried to include all
and one
, but from the wrong package (remark-rehype instead of mdast-util-to-hast). Apologies.
I understand that those are internal APIs and shouldn't be used. But is there any alternative?
@danielepolencic Alternative would be to roll your own all
/ one
, or you can pin the dep!
Ok, thanks. I'll pin the dep.
The current handler for a
paragraph
is defined as such:I can override the
paragraph
element with my custom handler:However, I can't call
all(node)
orone(node)
because the two utils are not exposed publicly. All the children for the paragraph are not rendered.Is it possible to expose the
all
andone
helper to allow subclassing of handlers? At the moment only the top level element can be customised.