From 5a43073eb2a2c740867589eb2a86e8793257cd5e Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE Date: Sat, 1 Jul 2023 18:03:02 +0530 Subject: [PATCH] fix: wordwrap disabled for html to text conversion --- .../apply-job-manually/apply-job-manually.component.ts | 3 +++ packages/core/src/employee-job/employee-job.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/gauzy/src/app/pages/jobs/search/components/apply-job-manually/apply-job-manually.component.ts b/apps/gauzy/src/app/pages/jobs/search/components/apply-job-manually/apply-job-manually.component.ts index 937ccc3ace9..78eb67c13aa 100644 --- a/apps/gauzy/src/app/pages/jobs/search/components/apply-job-manually/apply-job-manually.component.ts +++ b/apps/gauzy/src/app/pages/jobs/search/components/apply-job-manually/apply-job-manually.component.ts @@ -283,6 +283,8 @@ export class ApplyJobManuallyComponent extends TranslationBaseComponent implemen const { employeeId, proposal, rate, details, attachments } = this.form.value; const { providerCode, providerJobId } = this.employeeJobPost; + console.log(this.getPlainText()); + /** Apply job post input */ const applyJobPost: IEmployeeJobApplication = { applied: true, @@ -416,6 +418,7 @@ export class ApplyJobManuallyComponent extends TranslationBaseComponent implemen if (isNotEmpty(application)) { // Replace line breaks with spaces const proposal = application.proposal.replace(/\n\n/g, '

').replace(/\n/g, '
'); + console.log(proposal); // Set ckeditor html content this.ckeditor.instance.document.getBody().setHtml(proposal); diff --git a/packages/core/src/employee-job/employee-job.service.ts b/packages/core/src/employee-job/employee-job.service.ts index 7dcc5321105..a0cee7c4dfa 100644 --- a/packages/core/src/employee-job/employee-job.service.ts +++ b/packages/core/src/employee-job/employee-job.service.ts @@ -28,7 +28,7 @@ export class EmployeeJobPostService { private readonly employeeService: EmployeeService, private readonly gauzyAIService: GauzyAIService, private readonly countryService: CountryService - ) {} + ) { } /** * Updates job visibility @@ -61,7 +61,7 @@ export class EmployeeJobPostService { public async apply(input: IEmployeeJobApplication): Promise { try { const plainText = htmlToText(input.proposal, { - wordwrap: 120 // Specify the desired line width for word wrapping + wordwrap: false // Specify the desired line width for word wrapping }); input.proposal = plainText; } catch (error) {