diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/renderer/html-renderer.service.ts | 7 |
1 files changed, 5 insertions, 2 deletions
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 | } |