-
Notifications
You must be signed in to change notification settings - Fork 2
Markdown
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Helpers\Markdown is a lightweight Markdown-to-HTML converter.
It supports a focused subset for fast rendering and safe output.
Converts markdown text into HTML.
Supported features include:
- headings
- emphasis/strong
- links/images with URL sanitization
- inline/code blocks
- lists
- tables
- basic block structures
- HTML-sensitive characters are escaped
- URLs are sanitized by scheme (
http,https,mailto,tel,#fragment) - dangerous schemes (e.g.
javascript:) are rejected
$md = "# Title\n\nVisit [Pair](https://example.com).";
$html = \Pair\Helpers\Markdown::parse($md);Render table markdown:
$md = "| Name | Value |\n|:-----|------:|\n| A | 10 |";
$html = \Pair\Helpers\Markdown::parse($md);See also: TemplateRenderer, Utilities, View.