Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #87 #88

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## 3.4.2 (5. April 2024)

+ [#87](https://github.com/nadar/quill-delta-parser/issues/87) Fixed a bug where a line break preceding a list containing inline attributes results in improper HTML formatting for next paragraphs.

## 3.4.1 (13. March 2024)

+ [#84](https://github.com/nadar/quill-delta-parser/issues/84) Allow align `left` as possible value.
Expand Down
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;
}
Loading