@datafe-open/markdown-chart-markdown-it
v0.1.16
Published
Safe markdown-it placeholder adapter for Markdown Chart
Readme
@datafe-open/markdown-chart-markdown-it
A markdown-it fence plugin that emits safe generated placeholders. Chart source is returned through the render environment rather than copied into HTML.
Pass the live renderer registry to the plugin so explicitly registered aliases and dynamic renderer languages are routed without adapter-specific language configuration. A renderer identifier alone is not treated as a fence language:
const md = new MarkdownIt({ html: false })
.use(markdownChartPlugin, { registry });The canonical markdown-chart fence is always recognized. Advanced hosts may
supply an isChartLanguage predicate instead of, or in addition to, a
registry.
Collected blocks expose normalized language plus optional rawLanguage.
Mount hosts should pass rawLanguage ?? language back to the core so dynamic
legacy fence payloads such as case-sensitive sandbox file paths are preserved.
Streaming hosts can create the render environment with
createMarkdownChartEnvironment({ streaming: true }). Each collected
block then reports complete; closed blocks can mount immediately while an
unterminated tail block remains pending. Pending placeholders include the
package loading indicator; set the plugin loadingLabel option to localize its
text. Set the shared labels option to localize the placeholder's chart
accessibility label.
