Releases: taufik-nurrohman/parsedown-extra-plugin
Releases · taufik-nurrohman/parsedown-extra-plugin
v1.3.1
ditto
v1.3.0
Rename
v1.2.0
Fix #15
v1.2.0-beta-3
Update
v1.2.0-beta-2
- 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
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
Merge pull request #10 from tovic/renovate/configure Whatever.