Skip to content

Commit

Permalink
#438 add test for "word-break: break-all" css property
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Nov 5, 2024
1 parent 0f20604 commit a5d2f33
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 9.11.0 - see https://github.com/flyingsaucerproject/flyingsaucer/milestone/25
* Add support for `word-break:break-all` CSS property -- thanks to Kyle Stephens (#438)
* refactoring: remove setters and make many classes immutable (#434)

## 9.10.2 (29.10.2024) - see https://github.com/flyingsaucerproject/flyingsaucer/milestone/24?closed=1
* add overloaded method `addFontDirectory(... String encoding ...)`
* #431 fix interpretation of cell borders (#432)
Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-fop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-log4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-pdf-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion flying-saucer-pdf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.xhtmlrenderer.pdf;

import com.codeborne.pdftest.PDF;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import static com.codeborne.pdftest.assertj.Assertions.assertThat;

public class WordBreakTest {
private static final Logger log = LoggerFactory.getLogger(WordBreakTest.class);

@Test
void breakAll() throws IOException {

byte[] pdf = Html2Pdf.fromClasspathResource("org/xhtmlrenderer/pdf/break-all.html");
printFile(pdf, "break-all.pdf");
assertThat(new PDF(pdf)).containsExactText("HelloWorld1\nHelloWorld2\nHelloWorld3\nHelloWorld4\nHelloWorld5\n");
}

private static void printFile(byte[] pdf, String filename) throws IOException {
File file = new File("target", filename);
try (FileOutputStream o = new FileOutputStream(file)) {
o.write(pdf);
}
log.info("Generated PDF: {}", file.getAbsolutePath());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test::break-all</title>
</head>
<body>
<div style="width: 90px; border: 1px solid black; word-break: break-all;">
HelloWorld1HelloWorld2HelloWorld3HelloWorld4HelloWorld5
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion flying-saucer-swt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-parent</artifactId>
<version>9.10.3-SNAPSHOT</version>
<version>9.11.0-SNAPSHOT</version>

<packaging>pom</packaging>

Expand Down

0 comments on commit a5d2f33

Please sign in to comment.