Exclude task links and user mentions from nesting

This commit is contained in:
cl0ne
2018-07-21 20:32:39 +03:00
committed by Frédéric Guillot
parent 88228c3510
commit c44880a588
2 changed files with 27 additions and 0 deletions

View File

@@ -145,4 +145,17 @@ class Markdown extends Parsedown
array('task_id' => $task_id)
);
}
/**
* Exclude from nesting task links and user mentions for links
*
* @param array $Excerpt
* @return array|null
*/
protected function inlineLink($Excerpt)
{
$Inline = parent::inlineLink($Excerpt);
array_push($Inline['element']['nonNestables'], 'TaskLink', 'UserLink');
return $Inline;
}
}