This extends Parsedown to add support for server side code block rendering. This uses scrivo/highlight.php to do all the code block rendering. This will be fully compatible with Highlight JS.
You can install the package via composer:
> composer require sixlive/parsedown-highlight
# Hello!
Here is a post with some code in it.
\```php
<?php
echo 'foo';
\```
\```asldfh
put 'WHOOP!'
\```
$parsedown = new \sixlive\ParsedownHighlight;
$parsedown->text(file_get_contents(__DIR__.'/README.md'));
<h1>Hello!</h1>
<p>Here is a post with some code in it.</p>
<pre><code class="language-php hljs php"><span class="hljs-meta"><?php</span>
<span class="hljs-keyword">echo</span> <span class="hljs-string">'foo'</span>;</code></pre>
<pre><code class="language-asldfh">put 'WHOOP!'</code></pre>
Note: This requires version 0.8.0-beta-1
$parsedown = new \sixlive\ParsedownHighlightExtra;
$parsedown->text(file_get_contents(__DIR__.'/README.md'));
> composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
In addition to the php-cs-fixer rules, StyleCI will apply the Laravel preset.
> composer styles:lint
> composer styles:fix
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.