Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Commonmark Laravel Package

fluxbb/commonmark

Laravel-friendly CommonMark utilities from FluxBB: parse, render, and work with Markdown/CommonMark content in PHP with sensible defaults and integration patterns suited to Laravel apps. Lightweight package aimed at consistent, safe content rendering.

View on GitHub
Deep Wiki
Context7

An extensible CommonMark parser for PHP

Latest Stable Version Build Status License

An object oriented, fully extensible CommonMark parser for PHP 5.4 and above.

CommonMark spec

Requirements

  • PHP 5.4+
  • Composer

Installation

Add the library to your Composer dependencies:

composer require fluxbb/commonmark

Next, use Composer to install the library and its dependencies:

composer install

Usage

Parsing

use FluxBB\CommonMark\Parser;

$parser = new Parser();
$html = $parser->render('Markdown is **awesome**');

// <p>Markdown is <em>awesome</em></p>

Rendering

The parser renders XHTML by default.

Command Line Interface

Usage

Basic usage: (Outputs result to STDOUT)

bin/markdown /path/to/file.md

The following command saves results to a file:

bin/markdown /path/to/file.md > /path/to/file.html

Or using pipe (does not work on Windows):

echo "Markdown is **awesome**" | bin/markdown

Command Line Options

	--compress (-c)       Remove whitespace between HTML tags
	--lint (-l)           Syntax check only (lint)

Using PHAR version

You can also use a single phar file

markdown.phar /path/to/file.md

If you prefer access this command globally, download markdown.phar and move it into your PATH.

mv markdown.phar /usr/local/bin/markdown

Testing

Install or update dev dependencies.

php composer.phar update --dev

and run phpunit

License

The MIT License

Contributing

Feel free to fork this repository and send pull requests. Take a look at who has contributed so far.

Author

A big thanks to Kazuyuki Hayashi (@kzykhys), who originally created this library.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle