1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added strikethrough support to back-end md rendering

Needed to tweak the default library strikethrough extension
so that it uses the same element as front-end.
Added testing to cover.
For #2470.
This commit is contained in:
Dan Brown
2021-01-10 23:01:11 +00:00
parent 44315233d7
commit 28c706fee3
4 changed files with 60 additions and 0 deletions

View File

@ -461,4 +461,22 @@ class PageContentTest extends TestCase
$pageView = $this->get($page->getUrl());
$pageView->assertElementExists('.page-content input[type=checkbox]');
}
public function test_page_markdown_strikethrough_rendering()
{
$this->asEditor();
$page = Page::query()->first();
$content = '~~some crossed out text~~';
$this->put($page->getUrl(), [
'name' => $page->name, 'markdown' => $content,
'html' => '', 'summary' => ''
]);
$page->refresh();
$this->assertStringMatchesFormat('%A<s%A>some crossed out text</s>%A', $page->html);
$pageView = $this->get($page->getUrl());
$pageView->assertElementExists('.page-content p > s');
}
}