diff --git a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts index 8999824e..f293aba1 100644 --- a/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts +++ b/marketplace-ui/src/app/modules/product/product-detail/product-detail.component.ts @@ -462,7 +462,7 @@ export class ProductDetailComponent { md.use(MarkdownItGitHubAlerts); md.use(full); // Add emoji support const result = md.render(value); - this.sanitizer.sanitize(SecurityContext.HTML, result); - return this.sanitizer.bypassSecurityTrustHtml(result); + const safeHTML = this.sanitizer.sanitize(SecurityContext.HTML, result); + return safeHTML ? this.sanitizer.bypassSecurityTrustHtml(safeHTML) : ''; } } diff --git a/marketplace-ui/src/app/modules/release-preview/release-preview.component.ts b/marketplace-ui/src/app/modules/release-preview/release-preview.component.ts index a3107015..007515db 100644 --- a/marketplace-ui/src/app/modules/release-preview/release-preview.component.ts +++ b/marketplace-ui/src/app/modules/release-preview/release-preview.component.ts @@ -138,7 +138,7 @@ export class ReleasePreviewComponent { const md = MarkdownIt(); md.use(full); const result = md.render(value); - this.sanitizer.sanitize(SecurityContext.HTML, result); - return this.sanitizer.bypassSecurityTrustHtml(result); + const safeHTML = this.sanitizer.sanitize(SecurityContext.HTML, result); + return safeHTML ? this.sanitizer.bypassSecurityTrustHtml(safeHTML) : ''; } } diff --git a/marketplace-ui/src/app/modules/release-preview/release-preview.service.ts b/marketplace-ui/src/app/modules/release-preview/release-preview.service.ts index 95876bcc..36f54735 100644 --- a/marketplace-ui/src/app/modules/release-preview/release-preview.service.ts +++ b/marketplace-ui/src/app/modules/release-preview/release-preview.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; -import { Observable, of } from 'rxjs'; +import { Observable } from 'rxjs'; import { environment } from '../../../environments/environment'; import { ReleasePreviewData } from '../../shared/models/release-preview-data.model'; @Injectable({ diff --git a/marketplace-ui/src/assets/i18n/en.yaml b/marketplace-ui/src/assets/i18n/en.yaml index deef08c2..1d1f240d 100644 --- a/marketplace-ui/src/assets/i18n/en.yaml +++ b/marketplace-ui/src/assets/i18n/en.yaml @@ -8,7 +8,7 @@ common: title: Product Release Preview description: Preview your product's details buttonLabel: Upload - noTabs: Seem like there's a problem with your Zip file. + noTabs: Seems like there's a problem with your Zip file. hint: Only .zip file is allowed and file size should be smaller than 20MB. link: See how to configure a valid README. hintContent: