Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.

Checkboxes Fix for SafeValue content #142

Merged

Conversation

michaelkleinhenz
Copy link
Contributor

This fixes an issue with SafeValue content not correctly displayed in Markdown rendered fields.

@@ -23,7 +23,7 @@ import {
export class MarkdownComponent implements OnChanges, OnInit, AfterViewChecked {

@Input() fieldName: string = 'Description';
@Input('renderedText') inpRenderedText: string = '';
@Input('renderedText') inpRenderedText: any = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use SafeHtml instead of any?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because is can be a string (if there is no need for sanitation anyway) or a SafeValue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then can you do it, string | SafeHtml ?

@@ -42,7 +42,7 @@ export class MarkdownComponent implements OnChanges, OnInit, AfterViewChecked {
boxHeight: number;
enableShowMore: boolean = false;
// these need to be public for the tests accessing them.
renderedText = '';
renderedText: any = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use SafeHtml instead of any?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, coulbe be string or SafeValue. In fact, it will in most cases be just string. Only when someone wants to use extended HTML, he needs to wrap it in SafeValue. This way we give the user the option to either use it with sanitized HTML or with non-sanitized HTML.

@@ -23,7 +23,7 @@ import {
export class MarkdownComponent implements OnChanges, OnInit, AfterViewChecked {

@Input() fieldName: string = 'Description';
@Input('renderedText') inpRenderedText: string = '';
@Input('renderedText') inpRenderedText: any = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then can you do it, string | SafeHtml ?

@michaelkleinhenz michaelkleinhenz merged commit effb563 into fabric8-ui:master May 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants