framework/extensions/markdown/extend.php

31 lines
983 B
PHP
Raw Normal View History

2015-07-23 19:05:03 +08:00
<?php
2015-09-04 11:01:41 +08:00
/*
* This file is part of Flarum.
*
2019-11-30 07:02:13 +08:00
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
2015-09-04 11:01:41 +08:00
*/
2018-01-03 05:40:54 +08:00
use Flarum\Extend;
use s9e\TextFormatter\Configurator;
2015-07-23 19:05:03 +08:00
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less'),
(new Extend\Formatter)
->configure(function (Configurator $config) {
$config->Litedown;
// Overwrite the default inline spoiler so that it is compatible
// with more styling for children in an external stylesheet.
$config->tags['ispoiler']->template = '<span class="spoiler" data-s9e-livepreview-ignore-attrs="class" onclick="removeAttribute(\'class\')"><xsl:apply-templates/></span>';
}),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Settings)->serializeToForum('flarum-markdown.mdarea', 'flarum-markdown.mdarea', 'boolval', true)
];