diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-13 14:37:13 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-13 14:37:13 +0100 |
commit | cb38c9b9eaaf20abdb739553d7a3f1e1add8c604 (patch) | |
tree | 965ceaaa8a72046c6d98046dc88d4938b1450d5e /client/src/app | |
parent | 57d64f30e30b57ba5dc035fcaf38895d775412bd (diff) | |
download | PeerTube-cb38c9b9eaaf20abdb739553d7a3f1e1add8c604.tar.gz PeerTube-cb38c9b9eaaf20abdb739553d7a3f1e1add8c604.tar.zst PeerTube-cb38c9b9eaaf20abdb739553d7a3f1e1add8c604.zip |
Fix broadcast message inconsistency with preview
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/shared-forms/markdown-textarea.component.ts | 6 |
2 files changed, 5 insertions, 3 deletions
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 0f3803f97..22ae0852c 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 @@ | |||
137 | 137 | ||
138 | <my-markdown-textarea | 138 | <my-markdown-textarea |
139 | name="broadcastMessageMessage" formControlName="message" | 139 | name="broadcastMessageMessage" formControlName="message" |
140 | [formError]="formErrors['broadcastMessage.message']" | 140 | [formError]="formErrors['broadcastMessage.message']" markdownType="to-unsafe-html" |
141 | ></my-markdown-textarea> | 141 | ></my-markdown-textarea> |
142 | 142 | ||
143 | <div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div> | 143 | <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 c6527e169..7e2d3e4f4 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 { | |||
28 | 28 | ||
29 | @Input() truncate: number | 29 | @Input() truncate: number |
30 | 30 | ||
31 | @Input() markdownType: 'text' | 'enhanced' = 'text' | 31 | @Input() markdownType: 'text' | 'enhanced' | 'to-unsafe-html' = 'text' |
32 | @Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement> | 32 | @Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement> |
33 | 33 | ||
34 | @Input() debounceTime = 150 | 34 | @Input() debounceTime = 150 |
@@ -147,8 +147,10 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
147 | html = result | 147 | html = result |
148 | } else if (this.markdownType === 'text') { | 148 | } else if (this.markdownType === 'text') { |
149 | html = await this.markdownService.textMarkdownToHTML({ markdown: text }) | 149 | html = await this.markdownService.textMarkdownToHTML({ markdown: text }) |
150 | } else { | 150 | } else if (this.markdownType === 'enhanced') { |
151 | html = await this.markdownService.enhancedMarkdownToHTML({ markdown: text }) | 151 | html = await this.markdownService.enhancedMarkdownToHTML({ markdown: text }) |
152 | } else if (this.markdownType === 'to-unsafe-html') { | ||
153 | html = await this.markdownService.markdownToUnsafeHTML({ markdown: text }) | ||
152 | } | 154 | } |
153 | 155 | ||
154 | if (this.markdownVideo) { | 156 | if (this.markdownVideo) { |