RED-9889: escape html in component values.
This commit is contained in:
parent
15a675515d
commit
4a49e68c4a
@ -4,7 +4,7 @@
|
|||||||
<div class="value">
|
<div class="value">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
@for (componentValue of entry.componentValues; track componentValue) {
|
@for (componentValue of entry.componentValues; track componentValue) {
|
||||||
<span [innerHTML]="transformNewLines(componentValue.value ?? componentValue.originalValue)"></span>
|
<span [innerHTML]="transformNewLines(componentValue.value ?? componentValue.originalValue) | replaceNbsp"></span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
|||||||
@ -8,6 +8,8 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { IComponentLogEntry, IComponentValue } from '@red/domain';
|
import { IComponentLogEntry, IComponentValue } from '@red/domain';
|
||||||
import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value-dialog/revert-value-dialog.component';
|
import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value-dialog/revert-value-dialog.component';
|
||||||
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
import { FilePreviewStateService } from '../../services/file-preview-state.service';
|
||||||
|
import { escapeHtml } from '@common-ui/utils';
|
||||||
|
import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-editable-structured-component-value [entry] [canEdit]',
|
selector: 'redaction-editable-structured-component-value [entry] [canEdit]',
|
||||||
@ -28,6 +30,7 @@ import { FilePreviewStateService } from '../../services/file-preview-state.servi
|
|||||||
CdkDragHandle,
|
CdkDragHandle,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
|
ReplaceNbspPipe,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class EditableStructuredComponentValueComponent implements OnInit {
|
export class EditableStructuredComponentValueComponent implements OnInit {
|
||||||
@ -149,7 +152,7 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformNewLines(value: string) {
|
transformNewLines(value: string) {
|
||||||
return value.replace(/\n/g, '<br>');
|
return escapeHtml(value).replace(/\n/g, '<br>');
|
||||||
}
|
}
|
||||||
|
|
||||||
#getUniqueReferencesIds(values: IComponentValue[]) {
|
#getUniqueReferencesIds(values: IComponentValue[]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user