mdast-zone icon indicating copy to clipboard operation
mdast-zone copied to clipboard

Pass attributes and parameters to the handler

Open vitalets opened this issue 3 months ago • 0 comments

Initial checklist

Problem

mdast-comment-marker parses extra parameters from the comment. It would be useful if handler receive these parameters in the Info: E.g.:

<!-- foo start bar=42 -->
Foo
<!-- foo end -->

then in the handler:

zone(tree, 'foo', function (start, nodes, end, info) {
    console.log(info.parameters); // { bar: 42 }
    // ...
})

Current solutions

Parse the comment again.

Proposed solutions

Store info parameters in the scope and then pass to the handler.

vitalets avatar Oct 18 '25 12:10 vitalets