Skip to content

Commit

Permalink
Fix issue #87
Browse files Browse the repository at this point in the history
  • Loading branch information
shuedo committed Apr 5, 2024
1 parent a708164 commit b6c4364
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/listener/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function render(Lexer $lexer)

// If this element is empty we should maybe directly close and reopen this paragraph as it could be an empty line with
// a next elmenet
} elseif ($pick->line->isEmpty() && $next) {
} elseif ($pick->line->isEmpty() && $next && !$next->isDone()) {
$isOpen = $this->output($output, self::CLOSEP.self::OPENP, true);

// if its open, and it had an end newline, lets close
Expand Down
48 changes: 48 additions & 0 deletions tests/Issue87Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace nadar\quill\tests;

class Issue87Test extends DeltaTestCase
{
public $json = <<<'JSON'
{
"ops":
[
{
"insert": "This is begin text:\n\n"
},
{
"attributes": {
"bold": true
},
"insert": "Bold text"
},
{
"insert": " and regular text"
},
{
"attributes": {
"list": "bullet"
},
"insert": "\n"
},
{
"insert": "Another bullet"
},
{
"attributes": {
"list": "bullet"
},
"insert": "\n"
},
{
"insert": "Another text after list"
}
]
}
JSON;

public $html = <<<'EOT'
<p>This is begin text:</p><p><br></p><ul><li><strong>Bold text</strong> and regular text</li><li>Another bullet</li></ul><p>Another text after list</p>
EOT;
}

0 comments on commit b6c4364

Please sign in to comment.