bueltge/marksimple

View on GitHub
src/Rule/Code.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace Bueltge\Marksimple\Rule;

class Code extends AbstractRegexRule
{
    /**
     * {@inheritdoc}
     */
    public function rule(): string
    {
        return '#(?<!\\\)`([^\n]+?)`#';
    }

    /**
     * {@inheritdoc}
     */
    public function render(array $content): string
    {
        return sprintf('<code>%s</code>', $content[1]);
    }
}