Skip to content

comark v0.6.1

Choose a tag to compare

@farnabaz farnabaz released this 06 Aug 14:46
· 28 commits to main since this release
a6d1289

Highlights

It's all about performance:

  • Rangi highlighter — a new lightweight syntax-highlighting plugin via comark/plugins/rangi (optional peer dependency: rangi)
  • Default plugin controlregisterDefaultPlugins lets you enable or disable built-in plugins (frontmatter, html, alert, task-list, components, attributes)
  • Parse timing — the perf option records timing spans for autoclose, tokenization, node creation, and each plugin's pre/post hook

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

Features

View changes on GitHub