Skip to content

Commit

Permalink
fix retrieve md metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
PhieF committed Aug 20, 2023
1 parent 06d0b62 commit 2ab0fbf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Misc/NoteUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ public function getMetadata($carnetFolder, $path){

}
try{
$text = self::getTextFromHTML($node->get('index.html')->getContent());

if($node->nodeExists('index.html')) {
$text = self::getTextFromHTML($node->get('index.html')->getContent());
$meta['isMarkdown'] = false;
}
else {
$text = $node->get('note.md')->getContent();
$meta['isMarkdown'] = true;
}
$meta['shorttext'] = self::getShortText($text);
$meta['text'] = $text;
$meta['media'] = array();
Expand Down

0 comments on commit 2ab0fbf

Please sign in to comment.