mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added strike through support to Markdown
This commit is contained in:
@ -5,7 +5,8 @@ class CustomMarkdown extends \Michelf\Markdown
|
|||||||
{
|
{
|
||||||
$this->no_markup = true;
|
$this->no_markup = true;
|
||||||
$this->span_gamut += ['doSpoilers' => 71];
|
$this->span_gamut += ['doSpoilers' => 71];
|
||||||
$this->span_gamut += ['doUsers' => 7];
|
$this->span_gamut += ['doSpoilers' => 71];
|
||||||
|
$this->span_gamut += ['doStrike' => 6];
|
||||||
$this->span_gamut += ['doPosts' => 8];
|
$this->span_gamut += ['doPosts' => 8];
|
||||||
$this->span_gamut += ['doTags' => 9];
|
$this->span_gamut += ['doTags' => 9];
|
||||||
$this->span_gamut += ['doAutoLinks2' => 29];
|
$this->span_gamut += ['doAutoLinks2' => 29];
|
||||||
@ -45,6 +46,14 @@ class CustomMarkdown extends \Michelf\Markdown
|
|||||||
return preg_replace_callback('/\n/', [&$this, '_doHardBreaks_callback'], $text);
|
return preg_replace_callback('/\n/', [&$this, '_doHardBreaks_callback'], $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function doStrike($text)
|
||||||
|
{
|
||||||
|
return preg_replace_callback('{(~~|---)([^~]+)\1}', function($x)
|
||||||
|
{
|
||||||
|
return $this->hashPart('<del>') . $x[2] . $this->hashPart('</del>');
|
||||||
|
}, $text);
|
||||||
|
}
|
||||||
|
|
||||||
protected function doSpoilers($text)
|
protected function doSpoilers($text)
|
||||||
{
|
{
|
||||||
if (is_array($text))
|
if (is_array($text))
|
||||||
|
Reference in New Issue
Block a user