Fix Parsing for personal comments in bulk export

Fixes an error where HTML in motion comments was parsed
wrong during PDF bulk export
This commit is contained in:
Sean Engelhardt 2019-05-06 16:22:35 +02:00
parent e1b8e74e8d
commit 0f7733a25d

View File

@ -564,14 +564,7 @@ export class MotionPdfService {
// columnWidth = '100%'; // columnWidth = '100%';
// } // }
reason.push({ reason.push(this.addHtml(motion.reason));
columns: [
{
// width: columnWidth,
stack: this.htmlToPdfService.convertHtml(motion.reason)
}
]
});
return reason; return reason;
} else { } else {
@ -698,7 +691,7 @@ export class MotionPdfService {
this.configService.instant('motions_recommendation_text_mode'), this.configService.instant('motions_recommendation_text_mode'),
['submitters', 'state', 'category'] ['submitters', 'state', 'category']
); );
const noteContent = this.htmlToPdfService.convertHtml(note); const noteContent = this.htmlToPdfService.convertHtml(note, LineNumberingMode.None);
const subHeading = { const subHeading = {
text: this.translate.instant(noteTitle), text: this.translate.instant(noteTitle),
@ -713,12 +706,26 @@ export class MotionPdfService {
const viewComment = this.commentRepo.getViewModel(comment); const viewComment = this.commentRepo.getViewModel(comment);
const section = motion.getCommentForSection(viewComment); const section = motion.getCommentForSection(viewComment);
if (section && section.comment) { if (section && section.comment) {
result.push({ text: viewComment.name, style: 'heading3' }); result.push({ text: viewComment.name, style: 'heading3', margin: [0, 25, 0, 10] });
result.push({ result.push(this.addHtml(section.comment));
text: this.htmlToPdfService.convertHtml(section.comment)
});
} }
} }
return result; return result;
} }
/**
* Helper function to add simple rendered HTML in a new column-stack object.
* Prevents all kinds of malformation
*
* @param content the HTML content
*/
private addHtml(content: string): object {
return {
columns: [
{
stack: this.htmlToPdfService.convertHtml(content, LineNumberingMode.None)
}
]
};
}
} }