diff --git a/weasyprint/tests/test_layout.py b/weasyprint/tests/test_layout.py
index 10578389..48767f17 100644
--- a/weasyprint/tests/test_layout.py
+++ b/weasyprint/tests/test_layout.py
@@ -709,6 +709,21 @@ def test_breaking_linebox():
assert textbox_2.text == 'c def'
assert textbox_3.text == 'g hi'
+ # Regression test for https://github.com/Kozea/WeasyPrint/issues/560
+ page, = parse(
+ '
'
+ 'aaaa aaaa a [aaa]')
+ html, = page.children
+ body, = html.children
+ pre, = body.children
+ line1, line2, line3, line4 = pre.children
+ assert line1.children[0].text == line2.children[0].text == 'aaaa'
+ assert line3.children[0].text == 'a'
+ text1, span, text2 = line4.children
+ assert text1.text == '['
+ assert text2.text == ']'
+ assert span.children[0].text == 'aaa'
+
@assert_no_logs
def test_linebox_text():