From c44880a5889ebaaec61001dddd6ba4e0b322d623 Mon Sep 17 00:00:00 2001 From: cl0ne Date: Sat, 21 Jul 2018 20:32:39 +0300 Subject: Exclude task links and user mentions from nesting --- app/Core/Markdown.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/Core/Markdown.php') diff --git a/app/Core/Markdown.php b/app/Core/Markdown.php index b8fe618f..ae6adb5e 100644 --- a/app/Core/Markdown.php +++ b/app/Core/Markdown.php @@ -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; + } } -- cgit v1.2.3