Weave 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 Bundle Laravel Package

avensome/commonmark-bundle

View on GitHub
Deep Wiki
Context7

Avensome CommonMark Bundle

Provides seamless integration of CommonMark with Symfony and Twig.

Requires PHP 7.0+ and Symfony 4.0+.

Installation

Install with Composer:

composer require avensome/commonmark-bundle

Then add Avensome\CommonMarkBundle\AvensomeCommonMarkBundle to config/bundles.php:

<?php

return [
    // ...
    Avensome\CommonMarkBundle\AvensomeCommonMarkBundle::class => ['all' => true],
];

Usage in services

CommonMarkConverter is an injectable service:

<?php
use League\CommonMark\CommonMarkConverter;

class MyService
{
    public function __construct(CommonMarkConverter $converter)
    {
        // Do something with $converter
        // https://github.com/thephpleague/commonmark#basic-usage
    }
}

Usage in Twig

The markdown filter and tag are available in Twig.

{{ '# This string will be turned into HTML' | markdown }}

{% markdown %}
Contents of *these tags* will become HTML!

- Nunquam locus lanista.
- Neuter, barbatus solems aegre prensionem de secundus, salvus galatae.
- Rumor moris, tanquam castus verpa.
{% endmarkdown %}

Configuration

The CommonMarkConverter accepts configuration as one of its parameters. With this package you can adjust these in your Symfony configuration (config.yaml or similar). Just add the avensome_commonmark key, everything under it will be passed directly to the Converter.

# ...

avensome_commonmark:
    html_input: allow
    allow_unsafe_links: true

Extensions

To enable a CommonMark extension, just register it as a service and tag it with avensome_commonmark.extension.

For example to enable WebUni Table Extension, install it and edit your services.yaml:

services:
    # ...
    
    Webuni\CommonMark\TableExtension\TableExtension:
        tags:
            - name: avensome_commonmark.extension
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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel