aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-16 16:12:10 +0200
committerChocobozzz <me@florianbigard.com>2020-04-16 16:13:28 +0200
commit891bc2ffadd5dedae316fcc80856ff859e6f8336 (patch)
tree3fb13974f119a87d6fa45b4bcb8114ac34e00afa /client
parent5600def4c87d3e6b7724489c9c4415778ea014d3 (diff)
downloadPeerTube-891bc2ffadd5dedae316fcc80856ff859e6f8336.tar.gz
PeerTube-891bc2ffadd5dedae316fcc80856ff859e6f8336.tar.zst
PeerTube-891bc2ffadd5dedae316fcc80856ff859e6f8336.zip
Support rel="me" links in markdown
Diffstat (limited to 'client')
-rw-r--r--client/src/app/+admin/config/shared/batch-domains-validators.service.ts2
-rw-r--r--client/src/app/core/plugins/plugin.service.ts3
-rw-r--r--client/src/app/shared/renderer/html-renderer.service.ts7
3 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts b/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
index 154ef3a23..46fa6514d 100644
--- a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
+++ b/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators, ValidatorFn } from '@angular/forms' 2import { Validators, ValidatorFn } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator, validateHost } from '@app/shared' 4import { BuildFormValidator, validateHost } from '@app/shared/forms/form-validators'
5 5
6@Injectable() 6@Injectable()
7export class BatchDomainsValidatorsService { 7export class BatchDomainsValidatorsService {
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index b4ed56cbe..039fd6ff1 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -12,7 +12,8 @@ import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plu
12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' 12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type'
13import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model' 13import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
14import { HttpClient } from '@angular/common/http' 14import { HttpClient } from '@angular/common/http'
15import { AuthService, Notifier } from '@app/core' 15import { AuthService } from '@app/core/auth'
16import { Notifier } from '@app/core/notification'
16import { RestExtractor } from '@app/shared/rest' 17import { RestExtractor } from '@app/shared/rest'
17import { PluginType } from '@shared/models/plugins/plugin.type' 18import { PluginType } from '@shared/models/plugins/plugin.type'
18import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' 19import { PublicServerSetting } from '@shared/models/plugins/public-server.setting'
diff --git a/client/src/app/shared/renderer/html-renderer.service.ts b/client/src/app/shared/renderer/html-renderer.service.ts
index 94a8aa4c6..1ddd8fe2f 100644
--- a/client/src/app/shared/renderer/html-renderer.service.ts
+++ b/client/src/app/shared/renderer/html-renderer.service.ts
@@ -19,15 +19,18 @@ export class HtmlRendererService {
19 allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ], 19 allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ],
20 allowedSchemes: [ 'http', 'https' ], 20 allowedSchemes: [ 'http', 'https' ],
21 allowedAttributes: { 21 allowedAttributes: {
22 'a': [ 'href', 'class', 'target' ] 22 'a': [ 'href', 'class', 'target', 'rel' ]
23 }, 23 },
24 transformTags: { 24 transformTags: {
25 a: (tagName, attribs) => { 25 a: (tagName, attribs) => {
26 let rel = 'noopener noreferrer'
27 if (attribs.rel === 'me') rel += ' me'
28
26 return { 29 return {
27 tagName, 30 tagName,
28 attribs: Object.assign(attribs, { 31 attribs: Object.assign(attribs, {
29 target: '_blank', 32 target: '_blank',
30 rel: 'noopener noreferrer' 33 rel
31 }) 34 })
32 } 35 }
33 } 36 }