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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky