mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
* open links in markdown notes in new window (fixes GH-72)
(cherry picked from commit f9f97f3b7f)
This commit is contained in:
parent
87b6b2eca1
commit
7f6ca43728
1 changed files with 17 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
This file is a part of myTinyTodo.
|
||||
(C) Copyright 2022 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
(C) Copyright 2022-2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||
*/
|
||||
|
||||
|
|
@ -73,4 +73,20 @@ class MTTParsedown extends Parsedown
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function inlineLink($Excerpt) {
|
||||
$a = parent::inlineLink($Excerpt);
|
||||
if (is_array($a) && isset($a['element']['attributes']['href'])) {
|
||||
$a['element']['attributes']['target'] = '_blank';
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
|
||||
protected function inlineUrl($Excerpt) {
|
||||
$a = parent::inlineUrl($Excerpt);
|
||||
if (is_array($a) && isset($a['element']['attributes']['href'])) {
|
||||
$a['element']['attributes']['target'] = '_blank';
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue