Skip to content

Releases: taufik-nurrohman/parsedown-extra-plugin

v1.3.1

26 May 11:51
0e4373c
Compare
Choose a tag to compare
ditto

v1.3.0

12 May 21:35
Compare
Choose a tag to compare
Rename

v1.2.0

13 Mar 02:36
Compare
Choose a tag to compare
Fix #15

v1.2.0-beta-3

14 Dec 15:03
Compare
Choose a tag to compare
Update

v1.2.0-beta-2

31 Aug 17:45
Compare
Choose a tag to compare
  • Small bug fix → erusev/parsedown#546
  • Pass $Element by reference to easily update code block classes when using syntax highlighter → #12
$Parsedown->setBlockCodeHtml(function($Html, $Attributes, &$Element) {
    // ...
    // ...
    $Highlighted = $Highlighter->highlightAuto($Html);
    $Element['attributes']['class'] = 'hljs ' . $Highlighted->language;
    return $Highlighted->value;
});

Compatible with Parsedown Extra 0.8.0-beta-1

24 Aug 06:37
Compare
Choose a tag to compare

With new approach:

require 'Parsedown.php';
require 'ParsedownExtra.php';
require 'ParsedownExtraPlugin.php';

$Parsedown = new ParsedownExtraPlugin;

// Detect external links
$Parsedown->setLinkAttributes(function($Text, $Attributes, $Element, $Internal) {
    if (isset($Attributes['href'])) {
        if (!$Internal) {
            return array(
                'rel' => 'nofollow',
                'target' => '_blank'
            );
        }
    }
});

// Add border to tables
$Parsedown->setTableAttributes(array('border' => 1));

echo $Parsedown->text(file_get_contents('.\path\to\file.md'));

Old

22 Aug 16:28
4aa79ff
Compare
Choose a tag to compare
Old
Merge pull request #10 from tovic/renovate/configure

Whatever.