I see alot issue about change text and block style, like a Geshi or new styles
I see it's confuse create Extras for every block we need to change. I'm big fan of hooks, so, I implemented something like that to do any change on-the-fly.
Something like that:
$Parsedown = new Parsedown();
// Hook for change element blocks
$Parsedown->setTextHook(function($Element) {
// Look for code block
if($Element['name'] === "code") {
$geshi = new Geshi($Element['text'], str_replace("language-", "", $Element['attributes']['class']), "/media/backup/www/andor.com.br/library/General/Library/Geshi/geshi/");
$geshi->set_header_type(GESHI_HEADER_NONE);
unset($Element['text']);
$Element['rawHtml'] = $geshi->parse_code();
$Element['allowRawHtmlInSafeMode'] = TRUE;
}
// ANOTHER ONE TO CHANGE
elseif (1) {
}
// Return the same element block
return $Element;
});
I don't know if you like or it's can be useful for you. But, was already coded!
This sounds like a great feature to have, I also wanted to hook into Parsedown without modifying it directly to add some extra features. Shame this was request was closed!
I see alot issue about change text and block style, like a Geshi or new styles
I see it's confuse create Extras for every block we need to change. I'm big fan of hooks, so, I implemented something like that to do any change on-the-fly.
Something like that:
I don't know if you like or it's can be useful for you. But, was already coded!