Markdown document engine: parse, query, lint, build, render, and safely edit Markdown with minimal diffs.

Alto Markdown converts Markdown to safe HTML and keeps a source-backed document model when an application needs to inspect, lint, or edit content. Use direct conversion for one result; open a document when later work depends on its structure.

<?php
use Alto\Markdown\Markdown;

$html = Markdown::github()->toHtml("# Hello\n\nWelcome.\n");

Start

Conversion

  • HTML: render block or inline Markdown safely.
  • Markdown: preserve source or normalize output.

Documents

  • Profiles: choose CommonMark, GFM, or GitHub syntax.
  • Queries: find headings, sections, links, and code.
  • Statistics: compute one immutable document summary.
  • Editing: make source-preserving changes and save files.

Quality

  • Linting: report content and policy problems.
  • Fixing: apply enabled safe corrections.
  • Formatting: normalize selected Markdown style.

Extensions

Engine

  • Security: keep untrusted input within safe policies.
  • Performance: measure the correct processing lane.
  • Compliance: review supported Markdown specifications.

API

  • Overview: map the public surface by task.
  • Documents: factories, documents, and files.
  • Nodes: inspect and mutate typed handles.
  • Queries: collections, selectors, and statistics.
  • Editing: builders, patches, diffs, and saves.
  • Extensions: profile and extension contracts.
  • Exceptions: catch recoverable failures at boundaries.

HTML escapes authored raw HTML and rejects unsafe URL schemes by default. Read Security before changing those policies.