From c8fbe3d0b0f73bd1e4f86141498c035a2d1de472 Mon Sep 17 00:00:00 2001
From: shuedo <166110287+shuedo@users.noreply.github.com>
Date: Fri, 5 Apr 2024 16:44:40 +0200
Subject: [PATCH] Fix issue #87 (#88)
* Fix issue #87
* Added changelog
---------
Co-authored-by: Sandra Huedo
---
CHANGELOG.md | 4 ++++
src/listener/Text.php | 2 +-
tests/Issue87Test.php | 48 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 53 insertions(+), 1 deletion(-)
create mode 100644 tests/Issue87Test.php
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7554a7f..89e85ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
diff --git a/src/listener/Text.php b/src/listener/Text.php
index 5d7e876..e8595bc 100644
--- a/src/listener/Text.php
+++ b/src/listener/Text.php
@@ -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
diff --git a/tests/Issue87Test.php b/tests/Issue87Test.php
new file mode 100644
index 0000000..77a4283
--- /dev/null
+++ b/tests/Issue87Test.php
@@ -0,0 +1,48 @@
+This is begin text:
- Bold text and regular text
- Another bullet
Another text after list
+EOT;
+}
\ No newline at end of file