feat: add option to truncate long course descriptions to single line (default on, matches official PDF)

This commit is contained in:
adrianbonpin
2026-08-19 02:02:50 +08:00
parent b3b4495427
commit 106900860a
5 changed files with 57 additions and 4 deletions
+2 -1
View File
@@ -168,9 +168,10 @@
const included = ISMIStools.filterStudyLoadCourses(courses);
if (!included.length) throw new Error('No enrolled courses found.');
const totalUnits = ISMIStools.sumUnits(included);
const { truncateDescription } = await browser.storage.local.get('truncateDescription');
const res = await browser.runtime.sendMessage({
type: 'generate-pdf',
data: { header, courses: included, totalUnits }
data: { header, courses: included, totalUnits, truncateDescription: truncateDescription !== false }
});
if (!res || !res.ok) throw new Error((res && res.error) || 'PDF generation failed');
showToast('PDF downloaded.');