aboutsummaryrefslogtreecommitdiff
path: root/gen.js
diff options
context:
space:
mode:
Diffstat (limited to 'gen.js')
-rwxr-xr-xgen.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/gen.js b/gen.js
index 9f5bcea..723b8ad 100755
--- a/gen.js
+++ b/gen.js
@@ -185,7 +185,7 @@ db.dump().then(async (data) => {
});
// Quotes boats coats floats goats oats
- const genAuthor = (quote) => `${quote.name} ${quote.middlename || ""} ${quote.surname}`;
+ const genAuthor = (quote) => (quote ? `${quote.name} ${quote.middlename || ""} ${quote.surname}` : "");
textex = "\\def\\quoteclass{TGM13.1}\n\\quotepage";
let i = 0;
for (const quote of data.quotes) {
@@ -195,9 +195,12 @@ db.dump().then(async (data) => {
}
const author = genAuthor(quote);
if (i === 0 || author !== genAuthor(data.quotes[i - 1])) {
- textex += `\\quoteauthor{${author}}\n`;
+ textex += `\\quoteauthor{${author}}\\begin{itemize}\n`;
+ }
+ textex += `\\item \\quoteadd{${sanitize(quote.quote)}}\n`;
+ if (author !== genAuthor(data.quotes[i + 1])) {
+ textex += `\\end{itemize}\n`;
}
- textex += `\\quoteadd{${sanitize(quote.quote)}}\n`;
i++;
}
// Lol