v1.1.0
fromProsemirror
/fromPandoc
configuration now takes an arbitrary resources
object, instead of an arbitrary resource
function. This turns out to be much more ergonomic when dealing with many different kinds of transformable resources.
Old usage:
// ruleset
rules.toProsemirrorNode("Image", (node, { resource }) => {
return {
type: "image",
attrs: {
url: resource(node.target.url),
},
};
});
// invocation
fromPandoc(ast, rules, { resource: imageTransformFn });
New usage:
// ruleset
rules.toProsemirrorNode("Image", (node, { resources }) => {
return {
type: "image",
attrs: {
url: resources.image(node.target.url),
},
};
});
// invocation
fromPandoc(ast, rules, { resources: { image: imageTransformFn } });