The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

Customization

Configuration

You can provide an array of configuration options to the CommonMarkConverter when creating it::

<?php

use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter([
    'renderer' => [
        'block_separator' => "\n",
        'inner_separator' => "\n",
        'soft_break'      => "\n",
    ],
    'enable_em' => true,
    'enable_strong' => true,
    'use_asterisk' => true,
    'use_underscore' => true,
    'html_input' => 'escape',
    'allow_unsafe_links' => false,
]);

Here’s a list of currently-supported options:

The following options have been deprecated. They will no longer work once 1.0.0 is released:

Environment

The configuration is ultimately passed to (and managed via) the Environment. If you’re creating your own Environment, simply pass your config array into its constructor instead.

The Environment also exposes three methods for managing the configuration:

Learn more about customizing the Environment