summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-25 11:15:27 +0200
committerPaul Buetow <paul@buetow.org>2026-01-25 11:15:27 +0200
commite217e826ce2129aa64a762546f9bbe7b9d356cc9 (patch)
tree5f99fb5b8489cbdbbcf52874d8d6976527100c61
parent802d57c2c69aa4a6b21f3199fe08a806ce6aca11 (diff)
Render plot summaries with proper paragraph breaks
- Split summary text by double newlines into separate <p> tags - Rename section header from "Summary" to "Plot" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
-rw-r--r--js/app.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/app.js b/js/app.js
index 9ea8265..f6dd210 100644
--- a/js/app.js
+++ b/js/app.js
@@ -198,17 +198,19 @@ function openModal(bookId) {
// Get summary from book data (embedded by build.js)
const summary = book.summary;
- // Build summary section
+ // Build summary section - split into paragraphs
let summaryHtml;
if (summary) {
+ const paragraphs = summary.split(/\n\n+/).filter(p => p.trim());
+ const paragraphsHtml = paragraphs.map(p => `<p>${escapeHtml(p)}</p>`).join('\n');
summaryHtml = `
- <h3>Summary</h3>
- <p>${escapeHtml(summary)}</p>
+ <h3>Plot</h3>
+ ${paragraphsHtml}
`;
} else {
summaryHtml = `
- <h3>Summary</h3>
- <p class="no-summary">No summary available for this book.</p>
+ <h3>Plot</h3>
+ <p class="no-summary">No plot summary available for this book.</p>
`;
}