diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-13 12:25:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 12:25:12 +0200 |
commit | 8f269b49d7063af5a43021c8775b02d17205a7b5 (patch) | |
tree | b4236f5f7fd9fbd35b33b8e3a55624b380c914e7 /application | |
parent | 84045ffbb10c9d312b51dad972bae973c11aad3c (diff) | |
parent | 8fabcd0224b1122a48b495326854bb3562cd2e9d (diff) | |
download | Shaarli-8f269b49d7063af5a43021c8775b02d17205a7b5.tar.gz Shaarli-8f269b49d7063af5a43021c8775b02d17205a7b5.tar.zst Shaarli-8f269b49d7063af5a43021c8775b02d17205a7b5.zip |
Merge pull request #1521 from ArthurHoaro/feature/markdown-extra
Add Markdown Extra formatter
Diffstat (limited to 'application')
-rw-r--r-- | application/formatter/BookmarkMarkdownExtraFormatter.php | 24 | ||||
-rw-r--r-- | application/front/controller/admin/ConfigureController.php | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/application/formatter/BookmarkMarkdownExtraFormatter.php b/application/formatter/BookmarkMarkdownExtraFormatter.php new file mode 100644 index 00000000..0694b23f --- /dev/null +++ b/application/formatter/BookmarkMarkdownExtraFormatter.php | |||
@@ -0,0 +1,24 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Shaarli\Formatter; | ||
4 | |||
5 | use Shaarli\Config\ConfigManager; | ||
6 | |||
7 | /** | ||
8 | * Class BookmarkMarkdownExtraFormatter | ||
9 | * | ||
10 | * Format bookmark description into MarkdownExtra format. | ||
11 | * | ||
12 | * @see https://michelf.ca/projects/php-markdown/extra/ | ||
13 | * | ||
14 | * @package Shaarli\Formatter | ||
15 | */ | ||
16 | class BookmarkMarkdownExtraFormatter extends BookmarkMarkdownFormatter | ||
17 | { | ||
18 | public function __construct(ConfigManager $conf, bool $isLoggedIn) | ||
19 | { | ||
20 | parent::__construct($conf, $isLoggedIn); | ||
21 | |||
22 | $this->parsedown = new \ParsedownExtra(); | ||
23 | } | ||
24 | } | ||
diff --git a/application/front/controller/admin/ConfigureController.php b/application/front/controller/admin/ConfigureController.php index e675fcca..0ed7ad81 100644 --- a/application/front/controller/admin/ConfigureController.php +++ b/application/front/controller/admin/ConfigureController.php | |||
@@ -30,7 +30,7 @@ class ConfigureController extends ShaarliAdminController | |||
30 | 'theme_available', | 30 | 'theme_available', |
31 | ThemeUtils::getThemes($this->container->conf->get('resource.raintpl_tpl')) | 31 | ThemeUtils::getThemes($this->container->conf->get('resource.raintpl_tpl')) |
32 | ); | 32 | ); |
33 | $this->assignView('formatter_available', ['default', 'markdown']); | 33 | $this->assignView('formatter_available', ['default', 'markdown', 'markdownExtra']); |
34 | list($continents, $cities) = generateTimeZoneData( | 34 | list($continents, $cities) = generateTimeZoneData( |
35 | timezone_identifiers_list(), | 35 | timezone_identifiers_list(), |
36 | $this->container->conf->get('general.timezone') | 36 | $this->container->conf->get('general.timezone') |