]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-instance/instance.service.ts
feat(about): render images in markdown (#5732)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-instance / instance.service.ts
index 70e02217893c3f5df6eecf9c1d2b19a552c0eea0..2defffbbedbfcd9c940c2590034cbafd043ce04b 100644 (file)
@@ -7,6 +7,11 @@ import { peertubeTranslate } from '@shared/core-utils/i18n'
 import { About } from '@shared/models'
 import { environment } from '../../../environments/environment'
 
+export type AboutHTML = Pick<About['instance'],
+'terms' | 'codeOfConduct' | 'moderationInformation' | 'administrator' | 'creationReason' |
+'maintenanceLifetime' | 'businessModel' | 'hardwareInformation'
+>
+
 @Injectable()
 export class InstanceService {
   private static BASE_CONFIG_URL = environment.apiUrl + '/api/v1/config'
@@ -39,7 +44,7 @@ export class InstanceService {
   }
 
   async buildHtml (about: About) {
-    const html = {
+    const html: AboutHTML = {
       terms: '',
       codeOfConduct: '',
       moderationInformation: '',
@@ -51,7 +56,7 @@ export class InstanceService {
     }
 
     for (const key of Object.keys(html)) {
-      html[ key ] = await this.markdownService.textMarkdownToHTML(about.instance[ key ])
+      html[key] = await this.markdownService.enhancedMarkdownToHTML({ markdown: about.instance[key] })
     }
 
     return html