comark v0.6.1
Highlights
It's all about performance:
- Rangi highlighter — a new lightweight syntax-highlighting plugin via
comark/plugins/rangi(optional peer dependency:rangi) - Default plugin control —
registerDefaultPluginslets you enable or disable built-in plugins (frontmatter,html,alert,task-list,components,attributes) - Parse timing — the
perfoption records timing spans for autoclose, tokenization, node creation, and each plugin'spre/posthook
Deprecations
In this version, the highlight plugin is deprecated in favor of the shiki plugin. We also deprecate the html parser option in favor of the html plugin.
| Deprecated | Prefer | Notes |
|---|---|---|
comark/plugins/highlight |
comark/plugins/shiki |
Alias only; removed in the next major release |
Framework */plugins/highlight (e.g. @comark/svelte/plugins/highlight) |
*/plugins/shiki |
Same alias behavior |
HighlightOptions type |
ShikiOptions |
Kept as an alias |
ParserOptions.html |
registerDefaultPlugins: false + register html() when needed |
Warns at runtime; html: false still skips the default HTML plugin for now |
Migration snippets
// before
import highlight from 'comark/plugins/highlight'
// after
import shiki from 'comark/plugins/shiki'
// before
parseMarkdown(md, { html: false })
// after
parseMarkdown(md, {
registerDefaultPlugins: false,
// + register the plugins you want
})
// or keep the default plugins and explicitly omit the HTML plugin