Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix broadcast message inconsistency with preview

Chocobozzzcb38c9b9eaaf
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
index 0f3803f97e..22ae0852cb 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html
@@ -137,7 +137,7 @@
<my-markdown-textarea
name="broadcastMessageMessage" formControlName="message"
- [formError]="formErrors['broadcastMessage.message']"
+ [formError]="formErrors['broadcastMessage.message']" markdownType="to-unsafe-html"
></my-markdown-textarea>
<div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div>
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
index c6527e1696..7e2d3e4f4b 100644
--- a/client/src/app/shared/shared-forms/markdown-textarea.component.ts
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
@@ -28,7 +28,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
@Input() truncate: number
- @Input() markdownType: 'text' | 'enhanced' = 'text'
+ @Input() markdownType: 'text' | 'enhanced' | 'to-unsafe-html' = 'text'
@Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement>
@Input() debounceTime = 150
@@ -147,8 +147,10 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
html = result
} else if (this.markdownType === 'text') {
html = await this.markdownService.textMarkdownToHTML({ markdown: text })
- } else {
+ } else if (this.markdownType === 'enhanced') {
html = await this.markdownService.enhancedMarkdownToHTML({ markdown: text })
+ } else if (this.markdownType === 'to-unsafe-html') {
+ html = await this.markdownService.markdownToUnsafeHTML({ markdown: text })
}
if (this.markdownVideo) {