

GitHub - stefanzweifel/commonmark-markdown-renderer: Render a league/commonmark...
source link: https://github.com/stefanzweifel/commonmark-markdown-renderer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Render Markdown AST back to Markdown.
Render a league/commonmark AST back to Markdown.
Note: Markdown knows alternate syntaxes for the same elements (heading, emphasis, unordered lists, horizontal rules). Therefore input and output Markdown may differ.
Installation
You can install the package via composer:
composer require wnx/commonmark-markdown-renderer
Usage
use League\CommonMark\Environment\Environment; use League\CommonMark\Parser\MarkdownParser; use Wnx\CommonmarkMarkdownRenderer\MarkdownRendererExtension; use Wnx\CommonmarkMarkdownRenderer\Renderer\MarkdownRenderer; $environment = new Environment($config); $environment->addExtension(new MarkdownRendererExtension()); $markdownParser = new MarkdownParser($environment); $markdownRenderer = new MarkdownRenderer($environment); $markdown = "**Hello World!**"; $documentAST = $markdownParser->parse($markdown); // Manipulate AST in your script (append, prepend or replace nodes) $markdown = $markdownRenderer->renderDocument($documentAST);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Recommend
-
47
react-video-renderer Build custom video players effortless Render props, get all video state passed down as props. Bidirectional flow to render and update the video state in a de...
-
71
goldmark A markdown parser written in Go. Easy to extend, standard compliant, well structured. goldmark is compliant to CommonMark 0.29. Motivation I need a markdown parser for...
-
42
After 5 years of development, 3,000,000 downloads, and 58 releases, I'm extremely pleased to announce that
-
49
README.md Down
-
32
league/commonmark 1.3.0 Adds Full GFM Support!
-
6
league/commonmark league/commonmark is a highly-extensible PHP Markdown parser created by Colin O'Dell which supports the full CommonM...
-
22
Highlight code blocks with league/commonmark and Shiki This package contains a block renderer for league/commonmark to highlight code blocks using
-
10
Parse and Render ==marked text== with league/commonmark A league/commonmark extension to turn highlighted text into
-
6
Swift-DocC-Render-Artifact This repository holds a pre-built copy of the Swift-DocC-Render project auto-generated by the Swift.org CI system. Swift-DocC-Render is a...
-
5
Org Notebook Publisher Publish your org documents to a personally hosted web-based notebook. The notebook presents all note entries in a chronological index, where each entry can be maximized and minimized without opening a new page. Entr...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK