Skip to content

Commit

Permalink
Merge pull request #54 from humanmade/parsedown-1-7
Browse files Browse the repository at this point in the history
Fix compatibility with Parsedown 1.7
  • Loading branch information
joehoyle authored May 13, 2019
2 parents 0f3e9fb + 5de28df commit 44d2a1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require": {
"php": ">=7.1",
"erusev/parsedown": "^1.7",
"erusev/parsedown": "~1.7.0",
"mustangostang/spyc": "^0.6.2"
}
}
6 changes: 4 additions & 2 deletions inc/class-markdownparser.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ protected function inlineInternalLink( $result, $parts ) {
*/
protected function blockHeader( $data ) {
$block = parent::blockHeader( $data );
$id = sanitize_title_with_dashes( $block['element']['handler']['argument'] );
$id = sanitize_title_with_dashes( $block['element']['text'] );

return [
'element' => [
'name' => 'a',
Expand All @@ -164,7 +165,8 @@ protected function blockHeader( $data ) {
'id' => $id,
'class' => 'header-anchor',
],
'elements' => [ $block ],
'handler' => 'elements',
'text' => [ $block['element'] ],
],
];
}
Expand Down

0 comments on commit 44d2a1e

Please sign in to comment.