@@ -60,13 +60,21 @@ packages/comark/
6060│ │ ├── components.ts # Block/inline components + spans (`::name`, `:name`, `[text]`)
6161│ │ ├── attributes.ts # Inline attributes (`{props}` after tokens)
6262│ │ ├── emoji.ts # Emoji shortcodes
63- │ │ ├── highlight.ts # Syntax highlighting via Shiki (peer: shiki)
63+ │ │ ├── shiki.ts # Syntax highlighting via Shiki (peer: shiki)
64+ │ │ ├── highlight.ts # Deprecated alias → shiki (remove next major)
65+ │ │ ├── rangi.ts # Lightweight highlighting via rangi (peer: rangi)
6466│ │ ├── math.ts # LaTeX math via KaTeX (peer: katex)
6567│ │ ├── mermaid.ts # Mermaid diagrams (peer: beautiful-mermaid)
6668│ │ ├── security.ts # XSS/security sanitization
6769│ │ ├── summary.ts # Summary extraction
6870│ │ ├── task-list.ts # GFM task lists
6971│ │ └── toc.ts # Table of contents
72+ │ ├── utils/ # Shared utilities (comark/utils entry point)
73+ │ │ ├── index.ts # textContent(), visit(), visitAsync(), string/object utils
74+ │ │ ├── helpers.ts # defineComarkPlugin(), dedupePlugins()
75+ │ │ ├── caret.ts # Caret utilities for streaming
76+ │ │ ├── comark.tmLanguage.ts # Comark TextMate grammar (Shiki plugin)
77+ │ │ └── comark.rangiLanguage.ts # Comark rangi grammar (rangi plugin)
7078│ └── internal/ # Internal implementation (not exported)
7179│ ├── front-matter.ts
7280│ ├── parse/ # Parsing pipeline
@@ -80,7 +88,8 @@ packages/comark/
8088
8189| Peer | Required by |
8290| ------| -------------|
83- | ` shiki ` | ` comark/plugins/highlight ` |
91+ | ` shiki ` | ` comark/plugins/shiki ` |
92+ | ` rangi ` | ` comark/plugins/rangi ` |
8493| ` katex ` | ` comark/plugins/math ` |
8594| ` beautiful-mermaid ` | ` comark/plugins/mermaid ` |
8695
@@ -104,12 +113,12 @@ Located at `packages/comark-html/`. Framework-free HTML string rendering.
104113
105114``` typescript
106115import { createHtmlRenderer , renderHtml , renderHtmlFromDocument } from ' @comark/html'
107- import highlight from ' @comark/html/plugins/highlight '
116+ import shiki from ' @comark/html/plugins/shiki '
108117import math , { Math } from ' @comark/html/plugins/math'
109118
110119// Flat options — ParserOptions & RendererOptions merged at top level
111120const renderHtml = createHtmlRenderer ({
112- plugins: [highlight ({ themes: { light: ' github-light' , dark: ' github-dark' } })],
121+ plugins: [shiki ({ themes: { light: ' github-light' , dark: ' github-dark' } })],
113122 components: {
114123 Math ,
115124 alert : async ([, attrs , ... children ], { render }) =>
@@ -140,12 +149,12 @@ Located at `packages/comark-ansi/`. ANSI terminal renderer.
140149
141150``` typescript
142151import { createAnsiRenderer , createAnsiWriter , renderAnsi , renderAnsiFromDocument , writeAnsi } from ' @comark/ansi'
143- import highlight from ' @comark/ansi/plugins/highlight '
152+ import shiki from ' @comark/ansi/plugins/shiki '
144153import math , { Math } from ' @comark/ansi/plugins/math'
145154
146155// Flat options — ParserOptions & AnsiRendererOptions merged at top level
147156const writeAnsi = createAnsiWriter ({
148- plugins: [highlight (), math ()],
157+ plugins: [shiki (), math ()],
149158 components: { Math },
150159 width: 120 , // terminal width
151160 colors: true , // emit ANSI escape codes
@@ -379,7 +388,9 @@ import type { MarkdownDocument, Node, ElementNode, TextNode } from 'comark'
379388import { textContent , visit } from ' comark/utils'
380389
381390// Core plugins — use when calling parseMarkdown() directly (framework-agnostic)
382- import highlight from ' comark/plugins/highlight'
391+ import shiki from ' comark/plugins/shiki'
392+ import rangi , { comarkLanguage , comarkLanguages } from ' comark/plugins/rangi'
393+ // import highlight from 'comark/plugins/highlight' // deprecated alias → shiki
383394import math from ' comark/plugins/math'
384395import mermaid from ' comark/plugins/mermaid'
385396import emoji from ' comark/plugins/emoji'
@@ -396,18 +407,18 @@ import { markdownItAttributes } from 'comark/plugins/attributes'
396407
397408// NOTE: All framework packages re-export every core plugin via their own subpath.
398409// Prefer the framework-specific path when using a framework renderer:
399- // @comark/vue/plugins/highlight , @comark/react/plugins/highlight , etc.
410+ // @comark/vue/plugins/shiki , @comark/react/plugins/shiki , etc.
400411// Use comark/plugins/* only when calling parseMarkdown() without a framework renderer.
401412
402413// HTML rendering — parse + render to HTML string
403414import { createHtmlRenderer , renderHtml , renderHtmlFromDocument } from ' @comark/html'
404- import highlight from ' @comark/html/plugins/highlight '
415+ import shiki from ' @comark/html/plugins/shiki '
405416import math , { Math } from ' @comark/html/plugins/math'
406417import mermaid , { Mermaid } from ' @comark/html/plugins/mermaid'
407418
408419// ANSI terminal rendering — parse + render to styled terminal string
409420import { createAnsiRenderer , createAnsiWriter , renderAnsi , renderAnsiFromDocument , writeAnsi } from ' @comark/ansi'
410- import highlight from ' @comark/ansi/plugins/highlight '
421+ import shiki from ' @comark/ansi/plugins/shiki '
411422import math from ' @comark/ansi/plugins/math'
412423
413424// Vue — renderer + plugin wrappers (plugin fn + Vue component)
0 commit comments