aboutsummaryrefslogtreecommitdiff
path: root/cli.js
diff options
context:
space:
mode:
authorLarsVomMars2021-06-08 23:02:24 +0200
committerLarsVomMars2021-06-08 23:02:24 +0200
commitf78223bf08e491831ac12535c29b0e75e5e02449 (patch)
treeb9169923f7d5e9db2eb0356455f4007f41663b4e /cli.js
parent51ca21d20957b10cf4b33f05e1e42f4afa2ab680 (diff)
300
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/cli.js b/cli.js
index 0645e62..3eefef0 100755
--- a/cli.js
+++ b/cli.js
@@ -99,7 +99,7 @@ if ((idx = params.indexOf("-r")) > -1) {
const y10progs = JSON.parse(await fs.readFile(__dirname + "/progs.json", "utf8"));
await data.users.forEach(async (user) => {
hay = data.profile.filter((e) => e.user_id === user.id);
- let comments = user.comments;
+ let comments = user.comments.map((c) => ({ comment: sanitize(c.comment) }));
const chars = user.chars;
const obj = {
id: user.id,
@@ -143,7 +143,10 @@ if ((idx = params.indexOf("-r")) > -1) {
textex += "\\divider";
if (y10progs[user.id] && y10progs[user.id].length > 0)
- comments = [...comments, ...y10progs[user.id].map((comment) => ({ comment }))];
+ comments = [
+ ...comments,
+ ...y10progs[user.id].map((comment) => ({ comment: `\\textbf{${sanitize(comment)}}` })),
+ ];
comments = comments.sort((a, b) => a.comment.length - b.comment.length);
@@ -154,12 +157,12 @@ if ((idx = params.indexOf("-r")) > -1) {
for (let i = 0; i < comments.length; i += 2) {
const first = comments[i].comment;
if (comments[i] && !comments[i + 1]) {
- textex += `\\multicolumn{2}{p{\\commentswidth}}{\\RaggedRight{${sanitize(first)}}}`;
+ textex += `\\multicolumn{2}{p{\\commentswidth}}{\\RaggedRight{${first}}}`;
break;
}
const second = comments[i + 1] ? comments[i + 1].comment : " ";
- textex += `${sanitize(first)} & ${sanitize(second)} \\\\\n`;
+ textex += `${first} & ${second} \\\\\n`;
if (i + 2 < comments.length) textex += " \\specialrule{.03em}{0em}{0em}\n";
}
textex += "\\end{tabularx}\\renewcommand{\\arraystretch}{1}\\end{small}";