@coolon/angular-ui-powerups 16.1.0-alpha.349 → 16.1.0-alpha.350
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
3
|
import { ValueModel } from '@coolon/pectin';
|
|
3
4
|
import { MarkdownService } from '../../../services/markdown/markdown.service';
|
|
4
5
|
import { DisposableComponent } from '../../disposable-component';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
|
-
* Renders Markdown into the page as HTML,
|
|
8
|
-
*
|
|
9
|
-
* "(({name}))", whose text is escaped
|
|
8
|
+
* Renders Markdown into the page as HTML, sanitised as Angular sanitises a bound `[innerHTML]`:
|
|
9
|
+
* plain markup and its classes are kept, scripts and event handlers are dropped, and `javascript:`
|
|
10
|
+
* links are made inert. Text a user typed belongs in it only inside a pill, "(({name}))", whose text is escaped
|
|
11
|
+
* (`markdownPillExtension`). The HTML used to go in as Markdown made it, so a name holding "))"
|
|
12
|
+
* could end its pill early and put `<img src=x onerror=…>` into every message that named it.
|
|
10
13
|
*
|
|
11
14
|
* @example
|
|
12
15
|
* <aup-markdown [content]="..."></aup-markdown>
|
|
@@ -23,10 +26,11 @@ export declare class MarkdownComponent extends DisposableComponent implements On
|
|
|
23
26
|
private platform;
|
|
24
27
|
private readonly element;
|
|
25
28
|
private readonly markdownService;
|
|
29
|
+
private readonly sanitizer;
|
|
26
30
|
accessor content$: ValueModel<string>;
|
|
27
31
|
accessor content: string;
|
|
28
32
|
inline: boolean;
|
|
29
|
-
constructor(platform: object, element: ElementRef<HTMLElement>, markdownService: MarkdownService);
|
|
33
|
+
constructor(platform: object, element: ElementRef<HTMLElement>, markdownService: MarkdownService, sanitizer: DomSanitizer);
|
|
30
34
|
private extractInnerContent;
|
|
31
35
|
private renderContent;
|
|
32
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownComponent, never>;
|