]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/core-utils/renderer/html.ts
Try to reduce CSS size
[github/Chocobozzz/PeerTube.git] / shared / core-utils / renderer / html.ts
CommitLineData
9ff36c2d
C
1export const SANITIZE_OPTIONS = {
2 allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ],
3 allowedSchemes: [ 'http', 'https' ],
4 allowedAttributes: {
5 a: [ 'href', 'class', 'target', 'rel' ]
6 },
7 transformTags: {
47dc5db9 8 a: (tagName: string, attribs: any) => {
9ff36c2d
C
9 let rel = 'noopener noreferrer'
10 if (attribs.rel === 'me') rel += ' me'
11
12 return {
13 tagName,
14 attribs: Object.assign(attribs, {
15 target: '_blank',
16 rel
17 })
18 }
19 }
20 }
21}