PHP code example of daryledesilva / markdown-to-mrkdwn-php
1. Go to this page and download the library: Download daryledesilva/markdown-to-mrkdwn-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daryledesilva / markdown-to-mrkdwn-php example snippets
use DaryleDeSilva\MarkdownToMrkdwn\Converter;
$converter = new Converter();
// Global plugin (runs on full text)
$converter->registerPlugin(
'addQuotes',
fn(string $text) => "\"{$text}\"",
priority: 10,
scope: 'global'
);
// Line plugin (before standard conversion)
$converter->registerPlugin(
'linePrefix',
fn(string $line) => "[LINE] {$line}",
priority: 20,
scope: 'line',
timing: 'before'
);
echo $converter->convert("**Hello**, world!");