cleanup for add to dictionary issue with line-breaks and hyphens
This commit is contained in:
parent
9f115916d4
commit
44fcd9f26b
@ -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]) {
|
||||
|
||||
@ -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'">
|
||||
|
||||
@ -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'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user