Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/TestCase/Renderer/PlainTextRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Djot\DjotConverter;
use Djot\Event\RenderEvent;
use Djot\Node\Block\Figure;
use Djot\Node\Document;
use Djot\Node\Inline\Symbol;
use Djot\Renderer\PlainTextRenderer;
use Djot\Renderer\SoftBreakMode;
Expand Down Expand Up @@ -79,6 +81,20 @@ public function testFigureBetweenParagraphs(): void
$this->assertSame("Before.\n\na\nPanel caption\n\nAfter.\n", $this->renderer->render($document));
}

/**
* A figure with nothing renderable in it contributes no text at all - not
* even the blank line every other block terminates with. Reachable through
* the AST rather than through source: an empty figure div transformed by an
* extension leaves an empty panels container behind.
*/
public function testEmptyFigureRendersNothing(): void
{
$document = new Document();
$document->appendChild(new Figure());

$this->assertSame("\n", $this->renderer->render($document));
}

public function testHeadings(): void
{
$djot = "# Welcome\n\nThis is content.";
Expand Down
Loading