Text Rendering Tests

This EPUB tests text rendering edge cases.

Test Plan:

pre element: intrinsic line breaks preserved

pre element: leading/trailing blank lines

pre with inline code element

horizontal rules between paragraphs

pre: Intrinsic Line Breaks

The block below is a single <pre> element. Each source line must appear on its own line:

Line one
Line two
Line three

Normal paragraph after the pre block. Text resumes as a regular wrapped paragraph.

pre: Blank Lines

The pre block below contains intentional blank lines between code lines:

First line

Third line (blank line above)

Fifth line (blank line above)

Each blank line in the source should produce an empty line in the output.

pre with Nested code Element

Common EPUB pattern: <pre><code>...</code></pre>. Line breaks must still be preserved:

function greet(name) {
    return "Hello, " + name;
}

greet("World");

Normal paragraph after pre/code block.

Horizontal Rule Tests

A plain <hr> between two paragraphs. A thin line should appear between the two blocks of text.

Paragraph before the first rule. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Paragraph after the first rule. The rule above should be a full-width horizontal line.

Second rule above. Two rules in a row with no text between them:

Two rules appeared above. Now a rule at the very start of a section (right after the heading):

Rule appeared right after the heading. Finally, a rule near the end of the page to verify it does not cause a spurious page break when there is still room:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

End of horizontal rule tests.