diff --git a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp index c6c5723a..76a6901d 100644 --- a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp +++ b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp @@ -225,6 +225,7 @@ void ChapterHtmlSlimParser::flushPartWordBuffer() { currentTextBlock->addWord(partWordBuffer, fontStyle, false, nextWordContinues); partWordBufferIndex = 0; nextWordContinues = false; + listItemBulletOnly = false; } // start a new text block if needed @@ -254,6 +255,17 @@ void ChapterHtmlSlimParser::startNewTextBlock(const BlockStyle& blockStyle) { return; } + //
,
renders the bullet inline with the paragraph
+text, not on a separate line (GitHub issue #956).
+
Cases covered:
1. Standalone
between paragraphs (section break — must show gap).
2.
with a CSS class (calibre-style section break).
@@ -13,6 +16,9 @@ Cases covered:
4. Inline
inside a
(line break only — no extra gap).
5.
at start of chapter (no gap before first paragraph).
6.
following a heading.
+ 7.
with bold+italic text (bullet must be inline with text). + 8.
with nested
wrapper — baseline, already works). Visual verification instructions are embedded as the first paragraph of each chapter so a human tester can confirm the expected result on device. @@ -36,6 +42,12 @@ p { margin-top: 1pt; margin-bottom: 0; text-indent: 1em; text-align: justify; h1 { text-align: center; margin-top: 0.5em; margin-bottom: 0.5em; } h2 { text-align: center; margin-top: 0.5em; margin-bottom: 0.5em; } .section-br { display: block; } +.list-simple1 { margin-left: 1em; } +.list-item1 { text-indent: 0; } +.list-bullet { margin-left: 1em; } +.list-bullet2 { margin-left: 2em; } +.list { text-indent: 0; } +.list-item { text-indent: 0; } """ def xhtml(title, body): @@ -130,6 +142,55 @@ area above it despite the <br> being the very first element.
{FILLER}
""") +# --------------------------------------------------------------------------- +# Chapter 7 —with bold+italic (issue #956 example 1) +# --------------------------------------------------------------------------- +ch7 = xhtml("Ch7: li>p bold italic", """ +
PASS: Each bullet below must be on the SAME line as its text, not on a +separate line above it. The bullet and text are inline.
+Sketching User Experiences by Bill Buxton. This book examines the notion of sketching (Hint: prototypes are a kind of sketch) across a wide variety of disciplines, with eye-opening results.
Have Paper, Will Prototype by Bill Lucas. This lecture is a series of case studies about how to successfully create paper prototypes of computer interfaces.
The Kobold Guide to Board Game Design by Mike Selinker. The very best book there is on how to design great board games.
PASS: All three bullets above should be inline with their respective text.
+""") + +# --------------------------------------------------------------------------- +# Chapter 8 —with nested
PASS: Each bullet must be inline with its text. The nested list should be +indented further with its own bullets also inline.
+Problem statement: Design a flying dino game where dinosaurs race in and above the water.
Detailed problem statements
+We need to figure out if we can schedule all the animation time needed for the dinosaurs.
We need to develop the right number of levels for this game.
We need to figure out all the power-ups that will go into this game.
PASS: All bullets above should be inline with their text, including the nested ones.
+""") + +# --------------------------------------------------------------------------- +# Chapter 9 —wrapper, baseline) +# --------------------------------------------------------------------------- +ch9 = xhtml("Ch9: li direct text", """ +
PASS: Each bullet below must be inline with its text. This is the baseline +case that already works — no <p> wrapper inside <li>.
+PASS: All three bullets above should be inline with their text.
+""") + CHAPTERS = [ ("ch1", "chapter1.xhtml", "Chapter 1: Standalone br", ch1), ("ch2", "chapter2.xhtml", "Chapter 2: Classed br", ch2), @@ -137,6 +198,9 @@ CHAPTERS = [ ("ch4", "chapter4.xhtml", "Chapter 4: Inline br", ch4), ("ch5", "chapter5.xhtml", "Chapter 5: br after heading", ch5), ("ch6", "chapter6.xhtml", "Chapter 6: br at start", ch6), + ("ch7", "chapter7.xhtml", "Chapter 7: li>p bold italic", ch7), + ("ch8", "chapter8.xhtml", "Chapter 8: li>p nested ul", ch8), + ("ch9", "chapter9.xhtml", "Chapter 9: li direct text", ch9), ] def build_epub(path): @@ -177,7 +241,7 @@ def build_epub(path):