mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added in table + tasklist markdown rendering
For parity with markdown-it renderer. Added tests to cover. For #2452
This commit is contained in:
@ -420,4 +420,45 @@ class PageContentTest extends TestCase
|
||||
$page->refresh();
|
||||
$this->assertEquals('"Hello & welcome"', $page->text);
|
||||
}
|
||||
|
||||
public function test_page_markdown_table_rendering()
|
||||
{
|
||||
$this->asEditor();
|
||||
$page = Page::query()->first();
|
||||
|
||||
$content = '| Syntax | Description |
|
||||
| ----------- | ----------- |
|
||||
| Header | Title |
|
||||
| Paragraph | Text |';
|
||||
$this->put($page->getUrl(), [
|
||||
'name' => $page->name, 'markdown' => $content,
|
||||
'html' => '', 'summary' => ''
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertStringContainsString('</tbody>', $page->html);
|
||||
|
||||
$pageView = $this->get($page->getUrl());
|
||||
$pageView->assertElementExists('.page-content table tbody td');
|
||||
}
|
||||
|
||||
public function test_page_markdown_task_list_rendering()
|
||||
{
|
||||
$this->asEditor();
|
||||
$page = Page::query()->first();
|
||||
|
||||
$content = '- [ ] Item a
|
||||
- [x] Item b';
|
||||
$this->put($page->getUrl(), [
|
||||
'name' => $page->name, 'markdown' => $content,
|
||||
'html' => '', 'summary' => ''
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertStringContainsString('input', $page->html);
|
||||
$this->assertStringContainsString('type="checkbox"', $page->html);
|
||||
|
||||
$pageView = $this->get($page->getUrl());
|
||||
$pageView->assertElementExists('.page-content input[type=checkbox]');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user