@acheron-grid/markdown

Source preview文書リビジョン 10更新 2026-10-282eda14b

表示したソース版の開発用ドキュメントです。現在の公開範囲は npm 0.4.0 を選択してください。

技術本文は英語です。ナビゲーションは選択した言語に対応します。

Version 0.4.0 development preview. See release notes and migration.

The npm 0.1.0 archive has a separate frozen reference. See documentation versions.

Optional Markdown adapter for Acheron Grid. This experimental package depends on marked; core and Canvas do not. It does not require a DOM or import either grid package at runtime.

For source development, build the repository and install matching artifacts. A local file dependency may be used when your package manager resolves the complete workspace:

npm install /path/to/acheron-grid-engine/packages/markdown
import { markdownToHtml } from '@acheron-grid/markdown';

const grid = createGrid({
  container, columns, dataSource,
  richTextColumns: { notes: 'markdown', description: 'html' },
  markdownToHtml,
  wrapText: true,
  autoRowHeight: true,
  multilineEditor: true,
});

The adapter uses a private Marked instance with GFM disabled and raw HTML tokens omitted. It supports CommonMark-oriented syntax, including emphasis, links, code and lists. It is not a full document renderer or a claim of complete CommonMark conformance. Canvas editors display formatted text and serialize changed supported marks to source. Underline is available only in HTML columns using <u>; __text__ means bold in Markdown. Soft line breaks become spaces; visual editor line breaks serialize as hard breaks.

markdownToHtml(source) returns HTML for the Canvas text projection. It does not sanitize HTML for arbitrary DOM insertion. Canvas reads allowed formatting from an inert template, validates link URLs and paints text rather than mounting the markup. Its visual editor builds safe text/mark elements from that projection. Applications inserting the output into the DOM must sanitize it independently. Images are shown as alt text, with no resource loading. Sources longer than 100,000 characters are rejected by the adapter; Canvas shows an unavailable message rather than exposing source.

Applications may provide their own synchronous markdownToHtml callback instead. Canvas still applies its restricted text projection and URL validation. The standalone default playground does not import this adapter; direct browser users need an import map for the adapter and its marked dependency.

Licensed under Apache 2.0. Marked retains its own MIT license.

Installation

npm install @acheron-grid/[email protected]

Install core/Canvas at the same version when used. For newer APIs, use a built source checkout and install matching packed artifacts; see Getting started.

変更内容
  • r1 — Previous public reference; see source revision 9cff1ab.
  • r2 — Align publication status, installation and current source contracts.
  • r3 — Align publication status, installation and current source contracts.
  • r4 — Align publication status, installation and current source contracts.
  • r5 — Align publication status, installation and current source contracts.
  • r6 — Align publication status, installation and current source contracts.
  • r7 — Align publication status, installation and current source contracts.
  • r8 — Align publication status, installation and current source contracts.
  • r9 — Align publication status, installation and current source contracts.
  • r10 — Align publication status, installation and current source contracts.
Markdown を取得
ドキュメントの版