n0sz/commonmark-marker-extension

A marker extension for CommonMark PHP implementation

Installs: 17 579

Dependents: 3

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

Type:commonmark-extension

1.0.1 2022-09-27 20:19 UTC

This package is auto-updated.

Last update: 2024-10-28 01:16:26 UTC


README

This library adds support of highlighted text (<mark> HTML tag) to league/commonmark

Installation

This project can be installed via composer:

composer require n0sz/commonmark-marker-extension

Usage

use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use N0sz\CommonMark\Marker\MarkerExtension;


$environment->addExtension(new CommonMarkCoreExtension());
$environment->addExtension(new MarkerExtension());

Syntax

Code:

==Marker== on the left

Marker on the ==right==

==Marker everywhere==

Result:

<p><mark>Marker</mark> on the left</p>

<p>Marker on the <mark>right</mark></p>

<p><mark>Marker everywhere</mark></p>