Skip to content

Commit f861e59

Browse files
committed
Add tests for the list item renderer generation fix to avoid NPE on content split
DEVSIX-8935, DEVSIX-6877
1 parent 75eae24 commit f861e59

File tree

7 files changed

+77
-0
lines changed

7 files changed

+77
-0
lines changed

src/test/java/com/itextpdf/html2pdf/element/ListTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ public void convertingListOver2PagesTest() throws IOException, InterruptedExcept
226226
convertToPdfAndCompare("listOver2Pages", SOURCE_FOLDER, DESTINATION_FOLDER);
227227
}
228228

229+
@Test
230+
public void listSymbolWithoutTextSplitTest() throws IOException, InterruptedException {
231+
convertToPdfAndCompare("listSymbolWithoutTextSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
232+
}
233+
234+
@Test
235+
public void listWithImagesTest() throws IOException, InterruptedException {
236+
convertToPdfAndCompare("listWithImages", SOURCE_FOLDER, DESTINATION_FOLDER);
237+
}
238+
229239
// Android-Conversion-Skip-Block-Start (TODO DEVSIX-7372 investigate why a few tests related to PdfA in iTextCore and PdfHtml were cut)
230240
@Test
231241
@LogMessages(messages = {@LogMessage(messageTemplate = Html2PdfLogMessageConstant.NOT_SUPPORTED_LIST_STYLE_TYPE, count = 32)})
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<div style="height: 775px; background-color: blue">
5+
</div>
6+
<div>
7+
<ol>
8+
<li>
9+
<div>
10+
<h3>Response Checklist</h3>
11+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
12+
<div>
13+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p>
14+
<ol >
15+
<li>Option 1</li>
16+
</ol>
17+
<ul style="list-style-position: inside;" type="disc">
18+
<li>
19+
<ul >
20+
<li>Sub option 1</li>
21+
<li>Sub option 2</li>
22+
</ul>
23+
</li>
24+
</ul>
25+
<ol >
26+
<li>Option 2</li>
27+
</ol>
28+
<ul style="list-style-position: inside;" type="disc">
29+
<li>
30+
<ul >
31+
<li>Sub option 1</li>
32+
<li>Sub option 2</li>
33+
<li>Sub option 3</li>
34+
</ul>
35+
</li>
36+
</ul>
37+
<ol >
38+
<li>Option 3</li>
39+
</ol>
40+
<ul style="list-style-position: inside;" type="disc">
41+
<li>
42+
<ul>
43+
<li>Sub option 1</li>
44+
<li>Sub option 2</li>
45+
</ul>
46+
</li>
47+
</ul>
48+
</div>
49+
</div>
50+
<br/>
51+
</li>
52+
</ol>
53+
</div>
54+
55+
</body>
56+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
5+
<ul style="list-style-position: inside;" type="disc">
6+
<li><img src="sqpurple.gif" style="height: 30px"/></li>
7+
<li><img src="sqpurple.gif" style="height: 30px"/></li>
8+
</ul>
9+
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)