cleanup for add to dictionary issue with line-breaks and hyphens

This commit is contained in:
Timo Bejan 2021-07-29 14:31:05 +03:00
parent 9f115916d4
commit 44fcd9f26b
3 changed files with 9 additions and 2 deletions

View File

@ -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]) {

View File

@ -7,7 +7,7 @@
<div class="red-input-group">
<label translate="manual-annotation.dialog.content.text"></label>
</div>
{{ manualRedactionEntryWrapper.manualRedactionEntry.value }}
{{ format(manualRedactionEntryWrapper.manualRedactionEntry.value) }}
</ng-container>
<ng-container *ngIf="manualRedactionEntryWrapper.annotationType === 'RECTANGLE'">

View File

@ -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'
);
}
}