diff --git a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts index 19d4ca72a..d0c903424 100644 --- a/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/modules/dossier/components/pdf-viewer/pdf-viewer.component.ts @@ -543,7 +543,6 @@ export class PdfViewerComponent implements OnInit, OnChanges { } private _getManualRedactionEntry(quads: any, text: string, convertQuads: boolean = false): ManualRedactionEntry { - text = text.replace(/-\n/gi, ''); const entry: ManualRedactionEntry = { positions: [] }; for (const key of Object.keys(quads)) { for (const quad of quads[key]) { diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index 57c5ef08f..2b2c7427e 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -7,7 +7,7 @@
- {{ manualRedactionEntryWrapper.manualRedactionEntry.value }} + {{ format(manualRedactionEntryWrapper.manualRedactionEntry.value) }} diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 381c37e36..6e0d912b6 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -118,4 +118,12 @@ export class ManualAnnotationDialogComponent implements OnInit { const commentValue = this.redactionForm.get('comment').value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; } + + format(value: string) { + return value.replace( + // eslint-disable-next-line no-control-regex,max-len + /([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi, + '$1' + ); + } }