@covalent/markdown 4.0.0-beta.4 → 4.1.0-develop.2
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.
- package/README.md +20 -20
- package/_markdown-theme.scss +1 -1
- package/covalent-markdown.d.ts +1 -1
- package/esm2020/covalent-markdown.mjs +2 -2
- package/esm2020/lib/markdown-loader/markdown-loader.service.mjs +41 -0
- package/esm2020/lib/markdown-utils/markdown-utils.mjs +115 -0
- package/esm2020/lib/markdown.component.mjs +292 -0
- package/esm2020/lib/markdown.module.mjs +21 -0
- package/esm2020/public_api.mjs +5 -5
- package/fesm2015/covalent-markdown.mjs +62 -63
- package/fesm2015/covalent-markdown.mjs.map +1 -1
- package/fesm2020/covalent-markdown.mjs +80 -70
- package/fesm2020/covalent-markdown.mjs.map +1 -1
- package/{markdown-loader → lib/markdown-loader}/markdown-loader.service.d.ts +0 -0
- package/lib/markdown-utils/markdown-utils.d.ts +9 -0
- package/{markdown.component.d.ts → lib/markdown.component.d.ts} +0 -0
- package/{markdown.module.d.ts → lib/markdown.module.d.ts} +0 -0
- package/package.json +11 -31
- package/public_api.d.ts +4 -4
- package/esm2020/index.mjs +0 -2
- package/esm2020/markdown-loader/markdown-loader.service.mjs +0 -36
- package/esm2020/markdown-utils/markdown-utils.mjs +0 -115
- package/esm2020/markdown.component.mjs +0 -286
- package/esm2020/markdown.module.mjs +0 -22
- package/index.d.ts +0 -1
- package/markdown-utils/markdown-utils.d.ts +0 -9
- package/markdown.component.scss +0 -634
|
@@ -3,6 +3,7 @@ import { EventEmitter, SecurityContext, Component, HostBinding, Input, Output, I
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import * as i1$1 from '@angular/common/http';
|
|
5
5
|
import { HttpClientModule } from '@angular/common/http';
|
|
6
|
+
import * as showdown from 'showdown';
|
|
6
7
|
import * as i1 from '@angular/platform-browser';
|
|
7
8
|
import { __awaiter } from 'tslib';
|
|
8
9
|
|
|
@@ -14,7 +15,7 @@ function removeLeadingHash(str) {
|
|
|
14
15
|
}
|
|
15
16
|
function removeTrailingHash(str) {
|
|
16
17
|
if (str) {
|
|
17
|
-
return str.replace(
|
|
18
|
+
return str.replace(/#.*/, '');
|
|
18
19
|
}
|
|
19
20
|
return '';
|
|
20
21
|
}
|
|
@@ -25,14 +26,14 @@ function genHeadingId(str) {
|
|
|
25
26
|
// Remove certain special chars to create heading ids similar to those in github
|
|
26
27
|
// borrowed from showdown
|
|
27
28
|
// https://github.com/showdownjs/showdown/blob/develop/src/subParsers/makehtml/headers.js#L94
|
|
28
|
-
.replace(/[
|
|
29
|
+
.replace(/[&+$,/:;=?@"#{}|^¨~[\]`\\*)(%.!'<>]/g, '')).toLowerCase();
|
|
29
30
|
}
|
|
30
31
|
return '';
|
|
31
32
|
}
|
|
32
33
|
function scrollToAnchor(scope, anchor, tryParent) {
|
|
33
34
|
if (scope && anchor) {
|
|
34
35
|
const normalizedAnchor = genHeadingId(anchor);
|
|
35
|
-
let headingToJumpTo;
|
|
36
|
+
let headingToJumpTo = null;
|
|
36
37
|
const headingWithinComponent = scope.querySelector(`[id="${normalizedAnchor}"]`);
|
|
37
38
|
if (headingWithinComponent) {
|
|
38
39
|
headingToJumpTo = headingWithinComponent;
|
|
@@ -81,14 +82,14 @@ function rawGithubHref(githubHref) {
|
|
|
81
82
|
}
|
|
82
83
|
function isGithubHref(href) {
|
|
83
84
|
try {
|
|
84
|
-
const temp = new URL(href);
|
|
85
|
+
const temp = new URL(href !== null && href !== void 0 ? href : '');
|
|
85
86
|
return temp.hostname === 'github.com';
|
|
86
87
|
}
|
|
87
88
|
catch (_a) {
|
|
88
89
|
return false;
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
|
-
function isRawGithubHref(href) {
|
|
92
|
+
function isRawGithubHref(href = '') {
|
|
92
93
|
try {
|
|
93
94
|
const temp = new URL(href);
|
|
94
95
|
return temp.hostname === RAW_GITHUB_HOSTNAME;
|
|
@@ -121,9 +122,6 @@ function renderVideoElements(html) {
|
|
|
121
122
|
.replace(ytPlaylist, convertPL);
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
const _c0 = ["*"];
|
|
125
|
-
/* tslint:disable-next-line */
|
|
126
|
-
let showdown = require('showdown/dist/showdown.js');
|
|
127
125
|
// TODO: assumes it is a github url
|
|
128
126
|
// allow override somehow
|
|
129
127
|
function generateAbsoluteHref(currentHref, relativeHref) {
|
|
@@ -141,12 +139,14 @@ function generateAbsoluteHref(currentHref, relativeHref) {
|
|
|
141
139
|
}
|
|
142
140
|
return correctUrl.href;
|
|
143
141
|
}
|
|
144
|
-
return
|
|
142
|
+
return '';
|
|
145
143
|
}
|
|
146
144
|
function normalizeHtmlHrefs(html, currentHref) {
|
|
147
145
|
if (currentHref) {
|
|
148
146
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
149
|
-
document
|
|
147
|
+
document
|
|
148
|
+
.querySelectorAll('a[href]')
|
|
149
|
+
.forEach((link) => {
|
|
150
150
|
const url = new URL(link.href);
|
|
151
151
|
const originalHash = url.hash;
|
|
152
152
|
if (isAnchorLink(link)) {
|
|
@@ -187,8 +187,11 @@ function normalizeHtmlHrefs(html, currentHref) {
|
|
|
187
187
|
function normalizeImageSrcs(html, currentHref) {
|
|
188
188
|
if (currentHref) {
|
|
189
189
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
190
|
-
document
|
|
191
|
-
|
|
190
|
+
document
|
|
191
|
+
.querySelectorAll('img[src]')
|
|
192
|
+
.forEach((image) => {
|
|
193
|
+
var _a;
|
|
194
|
+
const src = (_a = image.getAttribute('src')) !== null && _a !== void 0 ? _a : '';
|
|
192
195
|
try {
|
|
193
196
|
/* tslint:disable-next-line:no-unused-expression */
|
|
194
197
|
new URL(src);
|
|
@@ -196,8 +199,10 @@ function normalizeImageSrcs(html, currentHref) {
|
|
|
196
199
|
image.src = rawGithubHref(src);
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
|
-
catch (
|
|
200
|
-
image.src = generateAbsoluteHref(isGithubHref(currentHref)
|
|
202
|
+
catch (_b) {
|
|
203
|
+
image.src = generateAbsoluteHref(isGithubHref(currentHref)
|
|
204
|
+
? rawGithubHref(currentHref)
|
|
205
|
+
: currentHref, src);
|
|
201
206
|
}
|
|
202
207
|
// gh svgs need to have ?sanitize=true
|
|
203
208
|
if (isRawGithubHref(image.src)) {
|
|
@@ -215,7 +220,9 @@ function normalizeImageSrcs(html, currentHref) {
|
|
|
215
220
|
function addIdsToHeadings(html) {
|
|
216
221
|
if (html) {
|
|
217
222
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
218
|
-
document
|
|
223
|
+
document
|
|
224
|
+
.querySelectorAll('h1, h2, h3, h4, h5, h6')
|
|
225
|
+
.forEach((heading) => {
|
|
219
226
|
const id = genHeadingId(heading.innerHTML);
|
|
220
227
|
heading.setAttribute('id', id);
|
|
221
228
|
});
|
|
@@ -280,7 +287,10 @@ class TdMarkdownComponent {
|
|
|
280
287
|
}
|
|
281
288
|
ngOnChanges(changes) {
|
|
282
289
|
// only anchor changed
|
|
283
|
-
if (changes
|
|
290
|
+
if (changes['anchor'] &&
|
|
291
|
+
!changes['content'] &&
|
|
292
|
+
!changes['simpleLineBreaks'] &&
|
|
293
|
+
!changes['hostedUrl']) {
|
|
284
294
|
scrollToAnchor(this._elementRef.nativeElement, this._anchor, true);
|
|
285
295
|
}
|
|
286
296
|
else {
|
|
@@ -299,7 +309,8 @@ class TdMarkdownComponent {
|
|
|
299
309
|
this._ngZone.runOutsideAngular(() => {
|
|
300
310
|
this._anchorListener = this._renderer.listen(this._elementRef.nativeElement, 'click', (event) => {
|
|
301
311
|
const element = event.srcElement;
|
|
302
|
-
if (element.matches('a[href]') &&
|
|
312
|
+
if (element.matches('a[href]') &&
|
|
313
|
+
isAnchorLink(element)) {
|
|
303
314
|
this.handleAnchorClicks(event);
|
|
304
315
|
}
|
|
305
316
|
});
|
|
@@ -338,11 +349,12 @@ class TdMarkdownComponent {
|
|
|
338
349
|
scrollToAnchor(this._elementRef.nativeElement, hash, true);
|
|
339
350
|
}
|
|
340
351
|
_elementFromString(markupStr) {
|
|
352
|
+
var _a;
|
|
341
353
|
// Renderer2 doesnt have a parsing method, so we have to sanitize and use [innerHTML]
|
|
342
354
|
// to parse the string into DOM element for now.
|
|
343
355
|
const div = this._renderer.createElement('div');
|
|
344
356
|
this._renderer.appendChild(this._elementRef.nativeElement, div);
|
|
345
|
-
const html = this._domSanitizer.sanitize(SecurityContext.HTML, markupStr);
|
|
357
|
+
const html = (_a = this._domSanitizer.sanitize(SecurityContext.HTML, markupStr)) !== null && _a !== void 0 ? _a : '';
|
|
346
358
|
const htmlWithAbsoluteHrefs = normalizeHtmlHrefs(html, this._hostedUrl);
|
|
347
359
|
const htmlWithAbsoluteImgSrcs = normalizeImageSrcs(htmlWithAbsoluteHrefs, this._hostedUrl);
|
|
348
360
|
const htmlWithHeadingIds = addIdsToHeadings(htmlWithAbsoluteImgSrcs);
|
|
@@ -352,11 +364,16 @@ class TdMarkdownComponent {
|
|
|
352
364
|
}
|
|
353
365
|
_render(markdown) {
|
|
354
366
|
// Trim leading and trailing newlines
|
|
355
|
-
markdown = markdown
|
|
367
|
+
markdown = markdown
|
|
368
|
+
.replace(/^(\s|\t)*\n+/g, '')
|
|
369
|
+
.replace(/(\s|\t)*\n+(\s|\t)*$/g, '');
|
|
356
370
|
// Split markdown by line characters
|
|
357
371
|
let lines = markdown.split('\n');
|
|
358
372
|
// check how much indentation is used by the first actual markdown line
|
|
359
|
-
const
|
|
373
|
+
const firstLineWhitespaceMatch = lines[0].match(/^(\s|\t)*/);
|
|
374
|
+
const firstLineWhitespace = firstLineWhitespaceMatch
|
|
375
|
+
? firstLineWhitespaceMatch[0]
|
|
376
|
+
: '';
|
|
360
377
|
// Remove all indentation spaces so markdown can be parsed correctly
|
|
361
378
|
const startingWhitespaceRegex = new RegExp('^' + firstLineWhitespace);
|
|
362
379
|
lines = lines.map(function (line) {
|
|
@@ -374,40 +391,25 @@ class TdMarkdownComponent {
|
|
|
374
391
|
return converter.makeHtml(markdownToParse);
|
|
375
392
|
}
|
|
376
393
|
}
|
|
377
|
-
|
|
378
|
-
/** @nocollapse */ /** @nocollapse */ TdMarkdownComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TdMarkdownComponent, selectors: [["td-markdown"]], hostVars: 2, hostBindings: function TdMarkdownComponent_HostBindings(rf, ctx) {
|
|
379
|
-
|
|
380
|
-
i0.ɵɵclassMap(ctx.class);
|
|
381
|
-
}
|
|
382
|
-
}, inputs: { content: "content", simpleLineBreaks: "simpleLineBreaks", hostedUrl: "hostedUrl", anchor: "anchor" }, outputs: { contentReady: "contentReady" }, features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function TdMarkdownComponent_Template(rf, ctx) {
|
|
383
|
-
if (rf & 1) {
|
|
384
|
-
i0.ɵɵprojectionDef();
|
|
385
|
-
i0.ɵɵprojection(0);
|
|
386
|
-
}
|
|
387
|
-
}, styles: [".td-markdown[_nghost-%COMP%] a{background-color:transparent}.td-markdown[_nghost-%COMP%] a:active, .td-markdown[_nghost-%COMP%] a:hover{outline-width:0}.td-markdown[_nghost-%COMP%] strong{font-weight:inherit;font-weight:bolder}.td-markdown[_nghost-%COMP%] h1{font-size:2em;margin:.67em 0}.td-markdown[_nghost-%COMP%] img{border-style:none}.td-markdown[_nghost-%COMP%] svg:not(:root){overflow:hidden}.td-markdown[_nghost-%COMP%] code, .td-markdown[_nghost-%COMP%] kbd, .td-markdown[_nghost-%COMP%] pre{font-family:monospace;font-size:1em}.td-markdown[_nghost-%COMP%] hr{box-sizing:content-box;height:0;overflow:visible}.td-markdown[_nghost-%COMP%] input{font:inherit;margin:0}.td-markdown[_nghost-%COMP%] input{overflow:visible}.td-markdown[_nghost-%COMP%] button:-moz-focusring, .td-markdown[_nghost-%COMP%] [type=button]:-moz-focusring, .td-markdown[_nghost-%COMP%] [type=reset]:-moz-focusring, .td-markdown[_nghost-%COMP%] [type=submit]:-moz-focusring{outline:1px dotted ButtonText}.td-markdown[_nghost-%COMP%] [type=checkbox]{box-sizing:border-box;padding:0}.td-markdown[_nghost-%COMP%] table{border-spacing:0;border-collapse:collapse}.td-markdown[_nghost-%COMP%] td, .td-markdown[_nghost-%COMP%] th{padding:0}.td-markdown[_nghost-%COMP%] *{box-sizing:border-box}.td-markdown[_nghost-%COMP%] input{font:13px/1.4 Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol}.td-markdown[_nghost-%COMP%] a{text-decoration:none}.td-markdown[_nghost-%COMP%] a:hover, .td-markdown[_nghost-%COMP%] a:active{text-decoration:underline}.td-markdown[_nghost-%COMP%] hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border-bottom-width:1px;border-bottom-style:solid}.td-markdown[_nghost-%COMP%] hr:before{display:table;content:\"\"}.td-markdown[_nghost-%COMP%] hr:after{display:table;clear:both;content:\"\"}.td-markdown[_nghost-%COMP%] h1, .td-markdown[_nghost-%COMP%] h2, .td-markdown[_nghost-%COMP%] h3, .td-markdown[_nghost-%COMP%] h4, .td-markdown[_nghost-%COMP%] h5, .td-markdown[_nghost-%COMP%] h6{margin-top:0;margin-bottom:0;line-height:1.5}.td-markdown[_nghost-%COMP%] h1{font-size:30px}.td-markdown[_nghost-%COMP%] h2{font-size:21px}.td-markdown[_nghost-%COMP%] h3{font-size:16px}.td-markdown[_nghost-%COMP%] h4{font-size:14px}.td-markdown[_nghost-%COMP%] h5{font-size:12px}.td-markdown[_nghost-%COMP%] h6{font-size:11px}.td-markdown[_nghost-%COMP%] p{margin-top:0;margin-bottom:10px}.td-markdown[_nghost-%COMP%] blockquote{margin:0}.td-markdown[_nghost-%COMP%] ul, .td-markdown[_nghost-%COMP%] ol{padding-left:0;margin-top:0;margin-bottom:0}.td-markdown[_nghost-%COMP%] ol ol, .td-markdown[_nghost-%COMP%] ul ol{list-style-type:lower-roman}.td-markdown[_nghost-%COMP%] ul ul ol, .td-markdown[_nghost-%COMP%] ul ol ol, .td-markdown[_nghost-%COMP%] ol ul ol, .td-markdown[_nghost-%COMP%] ol ol ol{list-style-type:lower-alpha}.td-markdown[_nghost-%COMP%] dd{margin-left:0}.td-markdown[_nghost-%COMP%] code{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px}.td-markdown[_nghost-%COMP%] pre{margin-top:0;margin-bottom:0;font:12px Consolas,Liberation Mono,Menlo,Courier,monospace}.td-markdown[_nghost-%COMP%] .pl-0{padding-left:0!important}.td-markdown[_nghost-%COMP%] .pl-1{padding-left:3px!important}.td-markdown[_nghost-%COMP%] .pl-2{padding-left:6px!important}.td-markdown[_nghost-%COMP%] .pl-3{padding-left:12px!important}.td-markdown[_nghost-%COMP%] .pl-4{padding-left:24px!important}.td-markdown[_nghost-%COMP%] .pl-5{padding-left:36px!important}.td-markdown[_nghost-%COMP%] .pl-6{padding-left:48px!important}.td-markdown[_nghost-%COMP%] .form-select::-ms-expand{opacity:0}.td-markdown[_nghost-%COMP%] a:not([href]){color:inherit;text-decoration:none}.td-markdown[_nghost-%COMP%] h1, .td-markdown[_nghost-%COMP%] h2, .td-markdown[_nghost-%COMP%] h3, .td-markdown[_nghost-%COMP%] h4, .td-markdown[_nghost-%COMP%] h5, .td-markdown[_nghost-%COMP%] h6{margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}.td-markdown[_nghost-%COMP%] h1 .octicon-link, .td-markdown[_nghost-%COMP%] h2 .octicon-link, .td-markdown[_nghost-%COMP%] h3 .octicon-link, .td-markdown[_nghost-%COMP%] h4 .octicon-link, .td-markdown[_nghost-%COMP%] h5 .octicon-link, .td-markdown[_nghost-%COMP%] h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}.td-markdown[_nghost-%COMP%] h1:hover .anchor, .td-markdown[_nghost-%COMP%] h2:hover .anchor, .td-markdown[_nghost-%COMP%] h3:hover .anchor, .td-markdown[_nghost-%COMP%] h4:hover .anchor, .td-markdown[_nghost-%COMP%] h5:hover .anchor, .td-markdown[_nghost-%COMP%] h6:hover .anchor{text-decoration:none}.td-markdown[_nghost-%COMP%] h1:hover .anchor .octicon-link, .td-markdown[_nghost-%COMP%] h2:hover .anchor .octicon-link, .td-markdown[_nghost-%COMP%] h3:hover .anchor .octicon-link, .td-markdown[_nghost-%COMP%] h4:hover .anchor .octicon-link, .td-markdown[_nghost-%COMP%] h5:hover .anchor .octicon-link, .td-markdown[_nghost-%COMP%] h6:hover .anchor .octicon-link{visibility:visible}.td-markdown[_nghost-%COMP%] h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom-width:1px;border-bottom-style:solid}.td-markdown[_nghost-%COMP%] h1 .anchor{line-height:1}.td-markdown[_nghost-%COMP%] h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom-width:1px;border-bottom-style:solid}.td-markdown[_nghost-%COMP%] h2 .anchor{line-height:1}.td-markdown[_nghost-%COMP%] h3{font-size:1.5em;line-height:1.43}.td-markdown[_nghost-%COMP%] h3 .anchor{line-height:1.2}.td-markdown[_nghost-%COMP%] h4{font-size:1.25em}.td-markdown[_nghost-%COMP%] h4 .anchor{line-height:1.2}.td-markdown[_nghost-%COMP%] h5{font-size:1em}.td-markdown[_nghost-%COMP%] h5 .anchor{line-height:1.1}.td-markdown[_nghost-%COMP%] h6{font-size:1em}.td-markdown[_nghost-%COMP%] h6 .anchor{line-height:1.1}.td-markdown[_nghost-%COMP%] p, .td-markdown[_nghost-%COMP%] blockquote, .td-markdown[_nghost-%COMP%] ul, .td-markdown[_nghost-%COMP%] ol, .td-markdown[_nghost-%COMP%] dl, .td-markdown[_nghost-%COMP%] table, .td-markdown[_nghost-%COMP%] pre{margin-top:0;margin-bottom:16px}.td-markdown[_nghost-%COMP%] hr{margin:16px 0}.td-markdown[_nghost-%COMP%] ul, .td-markdown[_nghost-%COMP%] ol{padding-left:2em}.td-markdown[_nghost-%COMP%] ul ul, .td-markdown[_nghost-%COMP%] ul ol, .td-markdown[_nghost-%COMP%] ol ol, .td-markdown[_nghost-%COMP%] ol ul{margin-top:0;margin-bottom:0}.td-markdown[_nghost-%COMP%] li>p{margin-top:16px}.td-markdown[_nghost-%COMP%] dl{padding:0}.td-markdown[_nghost-%COMP%] dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.td-markdown[_nghost-%COMP%] dl dd{padding:0 16px;margin-bottom:16px}.td-markdown[_nghost-%COMP%] blockquote{padding:0 15px;border-left-width:4px;border-left-style:solid}.td-markdown[_nghost-%COMP%] blockquote>:first-child{margin-top:0}.td-markdown[_nghost-%COMP%] blockquote>:last-child{margin-bottom:0}.td-markdown[_nghost-%COMP%] table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.td-markdown[_nghost-%COMP%] table th{font-weight:700}.td-markdown[_nghost-%COMP%] table th, .td-markdown[_nghost-%COMP%] table td{padding:6px 13px;border-width:1px;border-style:solid}.td-markdown[_nghost-%COMP%] table tr{border-top-width:1px;border-top-style:solid}.td-markdown[_nghost-%COMP%] img{max-width:100%;box-sizing:content-box}.td-markdown[_nghost-%COMP%] code{padding:.2em 0;margin:0;font-size:85%;border-radius:3px}.td-markdown[_nghost-%COMP%] code:before, .td-markdown[_nghost-%COMP%] code:after{letter-spacing:-.2em}.td-markdown[_nghost-%COMP%] pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}.td-markdown[_nghost-%COMP%] .highlight{margin-bottom:16px}.td-markdown[_nghost-%COMP%] .highlight pre, .td-markdown[_nghost-%COMP%] pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px}.td-markdown[_nghost-%COMP%] .highlight pre{margin-bottom:0;word-break:normal}.td-markdown[_nghost-%COMP%] pre{word-wrap:normal}.td-markdown[_nghost-%COMP%] pre code{display:inline;max-width:none;max-width:initial;padding:0;margin:0;overflow:visible;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.td-markdown[_nghost-%COMP%] pre code:before, .td-markdown[_nghost-%COMP%] pre code:after{content:normal}.td-markdown[_nghost-%COMP%] kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;vertical-align:middle;border-style:solid;border-width:1px;border-radius:3px}.td-markdown[_nghost-%COMP%] .pl-c{color:#969896}.td-markdown[_nghost-%COMP%] .pl-c1, .td-markdown[_nghost-%COMP%] .pl-s .pl-v{color:#0086b3}.td-markdown[_nghost-%COMP%] .pl-e, .td-markdown[_nghost-%COMP%] .pl-en{color:#795da3}.td-markdown[_nghost-%COMP%] .pl-s .pl-s1, .td-markdown[_nghost-%COMP%] .pl-smi{color:#333}.td-markdown[_nghost-%COMP%] .pl-ent{color:#63a35c}.td-markdown[_nghost-%COMP%] .pl-k{color:#a71d5d}.td-markdown[_nghost-%COMP%] .pl-pds, .td-markdown[_nghost-%COMP%] .pl-s, .td-markdown[_nghost-%COMP%] .pl-s .pl-pse .pl-s1, .td-markdown[_nghost-%COMP%] .pl-sr, .td-markdown[_nghost-%COMP%] .pl-sr .pl-cce, .td-markdown[_nghost-%COMP%] .pl-sr .pl-sra, .td-markdown[_nghost-%COMP%] .pl-sr .pl-sre{color:#183691}.td-markdown[_nghost-%COMP%] .pl-v{color:#ed6a43}.td-markdown[_nghost-%COMP%] .pl-id{color:#b52a1d}.td-markdown[_nghost-%COMP%] .pl-ii{background-color:#b52a1d;color:#f8f8f8}.td-markdown[_nghost-%COMP%] .pl-sr .pl-cce{color:#63a35c;font-weight:700}.td-markdown[_nghost-%COMP%] .pl-ml{color:#693a17}.td-markdown[_nghost-%COMP%] .pl-mh, .td-markdown[_nghost-%COMP%] .pl-mh .pl-en, .td-markdown[_nghost-%COMP%] .pl-ms{color:#1d3e81;font-weight:700}.td-markdown[_nghost-%COMP%] .pl-mq{color:teal}.td-markdown[_nghost-%COMP%] .pl-mi{color:#333;font-style:italic}.td-markdown[_nghost-%COMP%] .pl-mb{color:#333;font-weight:700}.td-markdown[_nghost-%COMP%] .pl-md{background-color:#ffecec;color:#bd2c00}.td-markdown[_nghost-%COMP%] .pl-mi1{background-color:#eaffea;color:#55a532}.td-markdown[_nghost-%COMP%] .pl-mdr{color:#795da3;font-weight:700}.td-markdown[_nghost-%COMP%] .pl-mo{color:#1d3e81}.td-markdown[_nghost-%COMP%] kbd{display:inline-block;padding:3px 5px;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #cccccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px #bbb}.td-markdown[_nghost-%COMP%] .full-commit .btn-outline:not(:disabled):hover{color:#4078c0;border:1px solid #4078c0}.td-markdown[_nghost-%COMP%] :checked+.radio-label{position:relative;z-index:1;border-color:#4078c0}.td-markdown[_nghost-%COMP%] .octicon{display:inline-block;vertical-align:text-top;fill:currentColor}.td-markdown[_nghost-%COMP%] .task-list-item{list-style-type:none}.td-markdown[_nghost-%COMP%] .task-list-item+.task-list-item{margin-top:3px}.td-markdown[_nghost-%COMP%] .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}"] });
|
|
388
|
-
(function () {
|
|
389
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownComponent, [{
|
|
394
|
+
TdMarkdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.DomSanitizer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
395
|
+
TdMarkdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TdMarkdownComponent, selector: "td-markdown", inputs: { content: "content", simpleLineBreaks: "simpleLineBreaks", hostedUrl: "hostedUrl", anchor: "anchor" }, outputs: { contentReady: "contentReady" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host.td-markdown::ng-deep a{background-color:transparent}:host.td-markdown::ng-deep a:active,:host.td-markdown::ng-deep a:hover{outline-width:0}:host.td-markdown::ng-deep strong{font-weight:inherit;font-weight:bolder}:host.td-markdown::ng-deep h1{font-size:2em;margin:.67em 0}:host.td-markdown::ng-deep img{border-style:none}:host.td-markdown::ng-deep svg:not(:root){overflow:hidden}:host.td-markdown::ng-deep code,:host.td-markdown::ng-deep kbd,:host.td-markdown::ng-deep pre{font-family:monospace;font-size:1em}:host.td-markdown::ng-deep hr{box-sizing:content-box;height:0;overflow:visible}:host.td-markdown::ng-deep input{font:inherit;margin:0;overflow:visible}:host.td-markdown::ng-deep button:-moz-focusring,:host.td-markdown::ng-deep [type=button]:-moz-focusring,:host.td-markdown::ng-deep [type=reset]:-moz-focusring,:host.td-markdown::ng-deep [type=submit]:-moz-focusring{outline:1px dotted ButtonText}:host.td-markdown::ng-deep [type=checkbox]{box-sizing:border-box;padding:0}:host.td-markdown::ng-deep table{border-spacing:0;border-collapse:collapse}:host.td-markdown::ng-deep td,:host.td-markdown::ng-deep th{padding:0}:host.td-markdown::ng-deep *{box-sizing:border-box}:host.td-markdown::ng-deep input{font:13px/1.4 Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol}:host.td-markdown::ng-deep a{text-decoration:none}:host.td-markdown::ng-deep a:hover,:host.td-markdown::ng-deep a:active{text-decoration:underline}:host.td-markdown::ng-deep hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep hr:before{display:table;content:\"\"}:host.td-markdown::ng-deep hr:after{display:table;clear:both;content:\"\"}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:0;margin-bottom:0;line-height:1.5}:host.td-markdown::ng-deep h1{font-size:30px}:host.td-markdown::ng-deep h2{font-size:21px}:host.td-markdown::ng-deep h3{font-size:16px}:host.td-markdown::ng-deep h4{font-size:14px}:host.td-markdown::ng-deep h5{font-size:12px}:host.td-markdown::ng-deep h6{font-size:11px}:host.td-markdown::ng-deep p{margin-top:0;margin-bottom:10px}:host.td-markdown::ng-deep blockquote{margin:0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:0;margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ul ol{list-style-type:lower-roman}:host.td-markdown::ng-deep ul ul ol,:host.td-markdown::ng-deep ul ol ol,:host.td-markdown::ng-deep ol ul ol,:host.td-markdown::ng-deep ol ol ol{list-style-type:lower-alpha}:host.td-markdown::ng-deep dd{margin-left:0}:host.td-markdown::ng-deep code{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px}:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:0;font:12px Consolas,Liberation Mono,Menlo,Courier,monospace}:host.td-markdown::ng-deep .pl-0{padding-left:0!important}:host.td-markdown::ng-deep .pl-1{padding-left:3px!important}:host.td-markdown::ng-deep .pl-2{padding-left:6px!important}:host.td-markdown::ng-deep .pl-3{padding-left:12px!important}:host.td-markdown::ng-deep .pl-4{padding-left:24px!important}:host.td-markdown::ng-deep .pl-5{padding-left:36px!important}:host.td-markdown::ng-deep .pl-6{padding-left:48px!important}:host.td-markdown::ng-deep .form-select::-ms-expand{opacity:0}:host.td-markdown::ng-deep a:not([href]){color:inherit;text-decoration:none}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}:host.td-markdown::ng-deep h1 .octicon-link,:host.td-markdown::ng-deep h2 .octicon-link,:host.td-markdown::ng-deep h3 .octicon-link,:host.td-markdown::ng-deep h4 .octicon-link,:host.td-markdown::ng-deep h5 .octicon-link,:host.td-markdown::ng-deep h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}:host.td-markdown::ng-deep h1:hover .anchor,:host.td-markdown::ng-deep h2:hover .anchor,:host.td-markdown::ng-deep h3:hover .anchor,:host.td-markdown::ng-deep h4:hover .anchor,:host.td-markdown::ng-deep h5:hover .anchor,:host.td-markdown::ng-deep h6:hover .anchor{text-decoration:none}:host.td-markdown::ng-deep h1:hover .anchor .octicon-link,:host.td-markdown::ng-deep h2:hover .anchor .octicon-link,:host.td-markdown::ng-deep h3:hover .anchor .octicon-link,:host.td-markdown::ng-deep h4:hover .anchor .octicon-link,:host.td-markdown::ng-deep h5:hover .anchor .octicon-link,:host.td-markdown::ng-deep h6:hover .anchor .octicon-link{visibility:visible}:host.td-markdown::ng-deep h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h1 .anchor{line-height:1}:host.td-markdown::ng-deep h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h2 .anchor{line-height:1}:host.td-markdown::ng-deep h3{font-size:1.5em;line-height:1.43}:host.td-markdown::ng-deep h3 .anchor{line-height:1.2}:host.td-markdown::ng-deep h4{font-size:1.25em}:host.td-markdown::ng-deep h4 .anchor{line-height:1.2}:host.td-markdown::ng-deep h5{font-size:1em}:host.td-markdown::ng-deep h5 .anchor{line-height:1.1}:host.td-markdown::ng-deep h6{font-size:1em}:host.td-markdown::ng-deep h6 .anchor{line-height:1.1}:host.td-markdown::ng-deep p,:host.td-markdown::ng-deep blockquote,:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep dl,:host.td-markdown::ng-deep table,:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:16px}:host.td-markdown::ng-deep hr{margin:16px 0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:2em}:host.td-markdown::ng-deep ul ul,:host.td-markdown::ng-deep ul ol,:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ol ul{margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep li>p{margin-top:16px}:host.td-markdown::ng-deep dl{padding:0}:host.td-markdown::ng-deep dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}:host.td-markdown::ng-deep dl dd{padding:0 16px;margin-bottom:16px}:host.td-markdown::ng-deep blockquote{padding:0 15px;border-left-width:4px;border-left-style:solid}:host.td-markdown::ng-deep blockquote>:first-child{margin-top:0}:host.td-markdown::ng-deep blockquote>:last-child{margin-bottom:0}:host.td-markdown::ng-deep table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}:host.td-markdown::ng-deep table th{font-weight:700}:host.td-markdown::ng-deep table th,:host.td-markdown::ng-deep table td{padding:6px 13px;border-width:1px;border-style:solid}:host.td-markdown::ng-deep table tr{border-top-width:1px;border-top-style:solid}:host.td-markdown::ng-deep img{max-width:100%;box-sizing:content-box}:host.td-markdown::ng-deep code{padding:.2em 0;margin:0;font-size:85%;border-radius:3px}:host.td-markdown::ng-deep code:before,:host.td-markdown::ng-deep code:after{letter-spacing:-.2em}:host.td-markdown::ng-deep pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}:host.td-markdown::ng-deep .highlight{margin-bottom:16px}:host.td-markdown::ng-deep .highlight pre,:host.td-markdown::ng-deep pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px}:host.td-markdown::ng-deep .highlight pre{margin-bottom:0;word-break:normal}:host.td-markdown::ng-deep pre{word-wrap:normal}:host.td-markdown::ng-deep pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}:host.td-markdown::ng-deep pre code:before,:host.td-markdown::ng-deep pre code:after{content:normal}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;vertical-align:middle;border-style:solid;border-width:1px;border-radius:3px}:host.td-markdown::ng-deep .pl-c{color:#969896}:host.td-markdown::ng-deep .pl-c1,:host.td-markdown::ng-deep .pl-s .pl-v{color:#0086b3}:host.td-markdown::ng-deep .pl-e,:host.td-markdown::ng-deep .pl-en{color:#795da3}:host.td-markdown::ng-deep .pl-s .pl-s1,:host.td-markdown::ng-deep .pl-smi{color:#333}:host.td-markdown::ng-deep .pl-ent{color:#63a35c}:host.td-markdown::ng-deep .pl-k{color:#a71d5d}:host.td-markdown::ng-deep .pl-pds,:host.td-markdown::ng-deep .pl-s,:host.td-markdown::ng-deep .pl-s .pl-pse .pl-s1,:host.td-markdown::ng-deep .pl-sr,:host.td-markdown::ng-deep .pl-sr .pl-cce,:host.td-markdown::ng-deep .pl-sr .pl-sra,:host.td-markdown::ng-deep .pl-sr .pl-sre{color:#183691}:host.td-markdown::ng-deep .pl-v{color:#ed6a43}:host.td-markdown::ng-deep .pl-id{color:#b52a1d}:host.td-markdown::ng-deep .pl-ii{background-color:#b52a1d;color:#f8f8f8}:host.td-markdown::ng-deep .pl-sr .pl-cce{color:#63a35c;font-weight:700}:host.td-markdown::ng-deep .pl-ml{color:#693a17}:host.td-markdown::ng-deep .pl-mh,:host.td-markdown::ng-deep .pl-mh .pl-en,:host.td-markdown::ng-deep .pl-ms{color:#1d3e81;font-weight:700}:host.td-markdown::ng-deep .pl-mq{color:teal}:host.td-markdown::ng-deep .pl-mi{color:#333;font-style:italic}:host.td-markdown::ng-deep .pl-mb{color:#333;font-weight:700}:host.td-markdown::ng-deep .pl-md{background-color:#ffecec;color:#bd2c00}:host.td-markdown::ng-deep .pl-mi1{background-color:#eaffea;color:#55a532}:host.td-markdown::ng-deep .pl-mdr{color:#795da3;font-weight:700}:host.td-markdown::ng-deep .pl-mo{color:#1d3e81}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #cccccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px #bbb}:host.td-markdown::ng-deep .full-commit .btn-outline:not(:disabled):hover{color:#4078c0;border:1px solid #4078c0}:host.td-markdown::ng-deep :checked+.radio-label{position:relative;z-index:1;border-color:#4078c0}:host.td-markdown::ng-deep .octicon{display:inline-block;vertical-align:text-top;fill:currentColor}:host.td-markdown::ng-deep .task-list-item{list-style-type:none}:host.td-markdown::ng-deep .task-list-item+.task-list-item{margin-top:3px}:host.td-markdown::ng-deep .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}\n"] });
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownComponent, decorators: [{
|
|
390
397
|
type: Component,
|
|
391
|
-
args: [{ selector: 'td-markdown', template: "<ng-content></ng-content>\n", styles: [":host.td-markdown::ng-deep a{background-color:transparent}:host.td-markdown::ng-deep a:active,:host.td-markdown::ng-deep a:hover{outline-width:0}:host.td-markdown::ng-deep strong{font-weight:inherit;font-weight:bolder}:host.td-markdown::ng-deep h1{font-size:2em;margin:.67em 0}:host.td-markdown::ng-deep img{border-style:none}:host.td-markdown::ng-deep svg:not(:root){overflow:hidden}:host.td-markdown::ng-deep code,:host.td-markdown::ng-deep kbd,:host.td-markdown::ng-deep pre{font-family:monospace;font-size:1em}:host.td-markdown::ng-deep hr{box-sizing:content-box;height:0;overflow:visible}:host.td-markdown::ng-deep input{font:inherit;margin:0}:host.td-markdown::ng-deep input{overflow:visible}:host.td-markdown::ng-deep button:-moz-focusring,:host.td-markdown::ng-deep [type=button]:-moz-focusring,:host.td-markdown::ng-deep [type=reset]:-moz-focusring,:host.td-markdown::ng-deep [type=submit]:-moz-focusring{outline:1px dotted ButtonText}:host.td-markdown::ng-deep [type=checkbox]{box-sizing:border-box;padding:0}:host.td-markdown::ng-deep table{border-spacing:0;border-collapse:collapse}:host.td-markdown::ng-deep td,:host.td-markdown::ng-deep th{padding:0}:host.td-markdown::ng-deep *{box-sizing:border-box}:host.td-markdown::ng-deep input{font:13px/1.4 Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol}:host.td-markdown::ng-deep a{text-decoration:none}:host.td-markdown::ng-deep a:hover,:host.td-markdown::ng-deep a:active{text-decoration:underline}:host.td-markdown::ng-deep hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep hr:before{display:table;content:\"\"}:host.td-markdown::ng-deep hr:after{display:table;clear:both;content:\"\"}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:0;margin-bottom:0;line-height:1.5}:host.td-markdown::ng-deep h1{font-size:30px}:host.td-markdown::ng-deep h2{font-size:21px}:host.td-markdown::ng-deep h3{font-size:16px}:host.td-markdown::ng-deep h4{font-size:14px}:host.td-markdown::ng-deep h5{font-size:12px}:host.td-markdown::ng-deep h6{font-size:11px}:host.td-markdown::ng-deep p{margin-top:0;margin-bottom:10px}:host.td-markdown::ng-deep blockquote{margin:0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:0;margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ul ol{list-style-type:lower-roman}:host.td-markdown::ng-deep ul ul ol,:host.td-markdown::ng-deep ul ol ol,:host.td-markdown::ng-deep ol ul ol,:host.td-markdown::ng-deep ol ol ol{list-style-type:lower-alpha}:host.td-markdown::ng-deep dd{margin-left:0}:host.td-markdown::ng-deep code{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px}:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:0;font:12px Consolas,Liberation Mono,Menlo,Courier,monospace}:host.td-markdown::ng-deep .pl-0{padding-left:0!important}:host.td-markdown::ng-deep .pl-1{padding-left:3px!important}:host.td-markdown::ng-deep .pl-2{padding-left:6px!important}:host.td-markdown::ng-deep .pl-3{padding-left:12px!important}:host.td-markdown::ng-deep .pl-4{padding-left:24px!important}:host.td-markdown::ng-deep .pl-5{padding-left:36px!important}:host.td-markdown::ng-deep .pl-6{padding-left:48px!important}:host.td-markdown::ng-deep .form-select::-ms-expand{opacity:0}:host.td-markdown::ng-deep a:not([href]){color:inherit;text-decoration:none}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}:host.td-markdown::ng-deep h1 .octicon-link,:host.td-markdown::ng-deep h2 .octicon-link,:host.td-markdown::ng-deep h3 .octicon-link,:host.td-markdown::ng-deep h4 .octicon-link,:host.td-markdown::ng-deep h5 .octicon-link,:host.td-markdown::ng-deep h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}:host.td-markdown::ng-deep h1:hover .anchor,:host.td-markdown::ng-deep h2:hover .anchor,:host.td-markdown::ng-deep h3:hover .anchor,:host.td-markdown::ng-deep h4:hover .anchor,:host.td-markdown::ng-deep h5:hover .anchor,:host.td-markdown::ng-deep h6:hover .anchor{text-decoration:none}:host.td-markdown::ng-deep h1:hover .anchor .octicon-link,:host.td-markdown::ng-deep h2:hover .anchor .octicon-link,:host.td-markdown::ng-deep h3:hover .anchor .octicon-link,:host.td-markdown::ng-deep h4:hover .anchor .octicon-link,:host.td-markdown::ng-deep h5:hover .anchor .octicon-link,:host.td-markdown::ng-deep h6:hover .anchor .octicon-link{visibility:visible}:host.td-markdown::ng-deep h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h1 .anchor{line-height:1}:host.td-markdown::ng-deep h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h2 .anchor{line-height:1}:host.td-markdown::ng-deep h3{font-size:1.5em;line-height:1.43}:host.td-markdown::ng-deep h3 .anchor{line-height:1.2}:host.td-markdown::ng-deep h4{font-size:1.25em}:host.td-markdown::ng-deep h4 .anchor{line-height:1.2}:host.td-markdown::ng-deep h5{font-size:1em}:host.td-markdown::ng-deep h5 .anchor{line-height:1.1}:host.td-markdown::ng-deep h6{font-size:1em}:host.td-markdown::ng-deep h6 .anchor{line-height:1.1}:host.td-markdown::ng-deep p,:host.td-markdown::ng-deep blockquote,:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep dl,:host.td-markdown::ng-deep table,:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:16px}:host.td-markdown::ng-deep hr{margin:16px 0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:2em}:host.td-markdown::ng-deep ul ul,:host.td-markdown::ng-deep ul ol,:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ol ul{margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep li>p{margin-top:16px}:host.td-markdown::ng-deep dl{padding:0}:host.td-markdown::ng-deep dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}:host.td-markdown::ng-deep dl dd{padding:0 16px;margin-bottom:16px}:host.td-markdown::ng-deep blockquote{padding:0 15px;border-left-width:4px;border-left-style:solid}:host.td-markdown::ng-deep blockquote>:first-child{margin-top:0}:host.td-markdown::ng-deep blockquote>:last-child{margin-bottom:0}:host.td-markdown::ng-deep table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}:host.td-markdown::ng-deep table th{font-weight:700}:host.td-markdown::ng-deep table th,:host.td-markdown::ng-deep table td{padding:6px 13px;border-width:1px;border-style:solid}:host.td-markdown::ng-deep table tr{border-top-width:1px;border-top-style:solid}:host.td-markdown::ng-deep img{max-width:100%;box-sizing:content-box}:host.td-markdown::ng-deep code{padding:.2em 0;margin:0;font-size:85%;border-radius:3px}:host.td-markdown::ng-deep code:before,:host.td-markdown::ng-deep code:after{letter-spacing:-.2em}:host.td-markdown::ng-deep pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}:host.td-markdown::ng-deep .highlight{margin-bottom:16px}:host.td-markdown::ng-deep .highlight pre,:host.td-markdown::ng-deep pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px}:host.td-markdown::ng-deep .highlight pre{margin-bottom:0;word-break:normal}:host.td-markdown::ng-deep pre{word-wrap:normal}:host.td-markdown::ng-deep pre code{display:inline;max-width:none;max-width:initial;padding:0;margin:0;overflow:visible;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}:host.td-markdown::ng-deep pre code:before,:host.td-markdown::ng-deep pre code:after{content:normal}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;vertical-align:middle;border-style:solid;border-width:1px;border-radius:3px}:host.td-markdown::ng-deep .pl-c{color:#969896}:host.td-markdown::ng-deep .pl-c1,:host.td-markdown::ng-deep .pl-s .pl-v{color:#0086b3}:host.td-markdown::ng-deep .pl-e,:host.td-markdown::ng-deep .pl-en{color:#795da3}:host.td-markdown::ng-deep .pl-s .pl-s1,:host.td-markdown::ng-deep .pl-smi{color:#333}:host.td-markdown::ng-deep .pl-ent{color:#63a35c}:host.td-markdown::ng-deep .pl-k{color:#a71d5d}:host.td-markdown::ng-deep .pl-pds,:host.td-markdown::ng-deep .pl-s,:host.td-markdown::ng-deep .pl-s .pl-pse .pl-s1,:host.td-markdown::ng-deep .pl-sr,:host.td-markdown::ng-deep .pl-sr .pl-cce,:host.td-markdown::ng-deep .pl-sr .pl-sra,:host.td-markdown::ng-deep .pl-sr .pl-sre{color:#183691}:host.td-markdown::ng-deep .pl-v{color:#ed6a43}:host.td-markdown::ng-deep .pl-id{color:#b52a1d}:host.td-markdown::ng-deep .pl-ii{background-color:#b52a1d;color:#f8f8f8}:host.td-markdown::ng-deep .pl-sr .pl-cce{color:#63a35c;font-weight:700}:host.td-markdown::ng-deep .pl-ml{color:#693a17}:host.td-markdown::ng-deep .pl-mh,:host.td-markdown::ng-deep .pl-mh .pl-en,:host.td-markdown::ng-deep .pl-ms{color:#1d3e81;font-weight:700}:host.td-markdown::ng-deep .pl-mq{color:teal}:host.td-markdown::ng-deep .pl-mi{color:#333;font-style:italic}:host.td-markdown::ng-deep .pl-mb{color:#333;font-weight:700}:host.td-markdown::ng-deep .pl-md{background-color:#ffecec;color:#bd2c00}:host.td-markdown::ng-deep .pl-mi1{background-color:#eaffea;color:#55a532}:host.td-markdown::ng-deep .pl-mdr{color:#795da3;font-weight:700}:host.td-markdown::ng-deep .pl-mo{color:#1d3e81}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #cccccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px #bbb}:host.td-markdown::ng-deep .full-commit .btn-outline:not(:disabled):hover{color:#4078c0;border:1px solid #4078c0}:host.td-markdown::ng-deep :checked+.radio-label{position:relative;z-index:1;border-color:#4078c0}:host.td-markdown::ng-deep .octicon{display:inline-block;vertical-align:text-top;fill:currentColor}:host.td-markdown::ng-deep .task-list-item{list-style-type:none}:host.td-markdown::ng-deep .task-list-item+.task-list-item{margin-top:3px}:host.td-markdown::ng-deep .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}\n"] }]
|
|
392
|
-
}], function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: i0.NgZone }]; }, { class: [{
|
|
398
|
+
args: [{ selector: 'td-markdown', template: "<ng-content></ng-content>\n", styles: [":host.td-markdown::ng-deep a{background-color:transparent}:host.td-markdown::ng-deep a:active,:host.td-markdown::ng-deep a:hover{outline-width:0}:host.td-markdown::ng-deep strong{font-weight:inherit;font-weight:bolder}:host.td-markdown::ng-deep h1{font-size:2em;margin:.67em 0}:host.td-markdown::ng-deep img{border-style:none}:host.td-markdown::ng-deep svg:not(:root){overflow:hidden}:host.td-markdown::ng-deep code,:host.td-markdown::ng-deep kbd,:host.td-markdown::ng-deep pre{font-family:monospace;font-size:1em}:host.td-markdown::ng-deep hr{box-sizing:content-box;height:0;overflow:visible}:host.td-markdown::ng-deep input{font:inherit;margin:0;overflow:visible}:host.td-markdown::ng-deep button:-moz-focusring,:host.td-markdown::ng-deep [type=button]:-moz-focusring,:host.td-markdown::ng-deep [type=reset]:-moz-focusring,:host.td-markdown::ng-deep [type=submit]:-moz-focusring{outline:1px dotted ButtonText}:host.td-markdown::ng-deep [type=checkbox]{box-sizing:border-box;padding:0}:host.td-markdown::ng-deep table{border-spacing:0;border-collapse:collapse}:host.td-markdown::ng-deep td,:host.td-markdown::ng-deep th{padding:0}:host.td-markdown::ng-deep *{box-sizing:border-box}:host.td-markdown::ng-deep input{font:13px/1.4 Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol}:host.td-markdown::ng-deep a{text-decoration:none}:host.td-markdown::ng-deep a:hover,:host.td-markdown::ng-deep a:active{text-decoration:underline}:host.td-markdown::ng-deep hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep hr:before{display:table;content:\"\"}:host.td-markdown::ng-deep hr:after{display:table;clear:both;content:\"\"}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:0;margin-bottom:0;line-height:1.5}:host.td-markdown::ng-deep h1{font-size:30px}:host.td-markdown::ng-deep h2{font-size:21px}:host.td-markdown::ng-deep h3{font-size:16px}:host.td-markdown::ng-deep h4{font-size:14px}:host.td-markdown::ng-deep h5{font-size:12px}:host.td-markdown::ng-deep h6{font-size:11px}:host.td-markdown::ng-deep p{margin-top:0;margin-bottom:10px}:host.td-markdown::ng-deep blockquote{margin:0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:0;margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ul ol{list-style-type:lower-roman}:host.td-markdown::ng-deep ul ul ol,:host.td-markdown::ng-deep ul ol ol,:host.td-markdown::ng-deep ol ul ol,:host.td-markdown::ng-deep ol ol ol{list-style-type:lower-alpha}:host.td-markdown::ng-deep dd{margin-left:0}:host.td-markdown::ng-deep code{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px}:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:0;font:12px Consolas,Liberation Mono,Menlo,Courier,monospace}:host.td-markdown::ng-deep .pl-0{padding-left:0!important}:host.td-markdown::ng-deep .pl-1{padding-left:3px!important}:host.td-markdown::ng-deep .pl-2{padding-left:6px!important}:host.td-markdown::ng-deep .pl-3{padding-left:12px!important}:host.td-markdown::ng-deep .pl-4{padding-left:24px!important}:host.td-markdown::ng-deep .pl-5{padding-left:36px!important}:host.td-markdown::ng-deep .pl-6{padding-left:48px!important}:host.td-markdown::ng-deep .form-select::-ms-expand{opacity:0}:host.td-markdown::ng-deep a:not([href]){color:inherit;text-decoration:none}:host.td-markdown::ng-deep h1,:host.td-markdown::ng-deep h2,:host.td-markdown::ng-deep h3,:host.td-markdown::ng-deep h4,:host.td-markdown::ng-deep h5,:host.td-markdown::ng-deep h6{margin-top:1em;margin-bottom:16px;font-weight:700;line-height:1.4}:host.td-markdown::ng-deep h1 .octicon-link,:host.td-markdown::ng-deep h2 .octicon-link,:host.td-markdown::ng-deep h3 .octicon-link,:host.td-markdown::ng-deep h4 .octicon-link,:host.td-markdown::ng-deep h5 .octicon-link,:host.td-markdown::ng-deep h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}:host.td-markdown::ng-deep h1:hover .anchor,:host.td-markdown::ng-deep h2:hover .anchor,:host.td-markdown::ng-deep h3:hover .anchor,:host.td-markdown::ng-deep h4:hover .anchor,:host.td-markdown::ng-deep h5:hover .anchor,:host.td-markdown::ng-deep h6:hover .anchor{text-decoration:none}:host.td-markdown::ng-deep h1:hover .anchor .octicon-link,:host.td-markdown::ng-deep h2:hover .anchor .octicon-link,:host.td-markdown::ng-deep h3:hover .anchor .octicon-link,:host.td-markdown::ng-deep h4:hover .anchor .octicon-link,:host.td-markdown::ng-deep h5:hover .anchor .octicon-link,:host.td-markdown::ng-deep h6:hover .anchor .octicon-link{visibility:visible}:host.td-markdown::ng-deep h1{padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h1 .anchor{line-height:1}:host.td-markdown::ng-deep h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom-width:1px;border-bottom-style:solid}:host.td-markdown::ng-deep h2 .anchor{line-height:1}:host.td-markdown::ng-deep h3{font-size:1.5em;line-height:1.43}:host.td-markdown::ng-deep h3 .anchor{line-height:1.2}:host.td-markdown::ng-deep h4{font-size:1.25em}:host.td-markdown::ng-deep h4 .anchor{line-height:1.2}:host.td-markdown::ng-deep h5{font-size:1em}:host.td-markdown::ng-deep h5 .anchor{line-height:1.1}:host.td-markdown::ng-deep h6{font-size:1em}:host.td-markdown::ng-deep h6 .anchor{line-height:1.1}:host.td-markdown::ng-deep p,:host.td-markdown::ng-deep blockquote,:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep dl,:host.td-markdown::ng-deep table,:host.td-markdown::ng-deep pre{margin-top:0;margin-bottom:16px}:host.td-markdown::ng-deep hr{margin:16px 0}:host.td-markdown::ng-deep ul,:host.td-markdown::ng-deep ol{padding-left:2em}:host.td-markdown::ng-deep ul ul,:host.td-markdown::ng-deep ul ol,:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ol ul{margin-top:0;margin-bottom:0}:host.td-markdown::ng-deep li>p{margin-top:16px}:host.td-markdown::ng-deep dl{padding:0}:host.td-markdown::ng-deep dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}:host.td-markdown::ng-deep dl dd{padding:0 16px;margin-bottom:16px}:host.td-markdown::ng-deep blockquote{padding:0 15px;border-left-width:4px;border-left-style:solid}:host.td-markdown::ng-deep blockquote>:first-child{margin-top:0}:host.td-markdown::ng-deep blockquote>:last-child{margin-bottom:0}:host.td-markdown::ng-deep table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}:host.td-markdown::ng-deep table th{font-weight:700}:host.td-markdown::ng-deep table th,:host.td-markdown::ng-deep table td{padding:6px 13px;border-width:1px;border-style:solid}:host.td-markdown::ng-deep table tr{border-top-width:1px;border-top-style:solid}:host.td-markdown::ng-deep img{max-width:100%;box-sizing:content-box}:host.td-markdown::ng-deep code{padding:.2em 0;margin:0;font-size:85%;border-radius:3px}:host.td-markdown::ng-deep code:before,:host.td-markdown::ng-deep code:after{letter-spacing:-.2em}:host.td-markdown::ng-deep pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}:host.td-markdown::ng-deep .highlight{margin-bottom:16px}:host.td-markdown::ng-deep .highlight pre,:host.td-markdown::ng-deep pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;border-radius:3px}:host.td-markdown::ng-deep .highlight pre{margin-bottom:0;word-break:normal}:host.td-markdown::ng-deep pre{word-wrap:normal}:host.td-markdown::ng-deep pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}:host.td-markdown::ng-deep pre code:before,:host.td-markdown::ng-deep pre code:after{content:normal}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;vertical-align:middle;border-style:solid;border-width:1px;border-radius:3px}:host.td-markdown::ng-deep .pl-c{color:#969896}:host.td-markdown::ng-deep .pl-c1,:host.td-markdown::ng-deep .pl-s .pl-v{color:#0086b3}:host.td-markdown::ng-deep .pl-e,:host.td-markdown::ng-deep .pl-en{color:#795da3}:host.td-markdown::ng-deep .pl-s .pl-s1,:host.td-markdown::ng-deep .pl-smi{color:#333}:host.td-markdown::ng-deep .pl-ent{color:#63a35c}:host.td-markdown::ng-deep .pl-k{color:#a71d5d}:host.td-markdown::ng-deep .pl-pds,:host.td-markdown::ng-deep .pl-s,:host.td-markdown::ng-deep .pl-s .pl-pse .pl-s1,:host.td-markdown::ng-deep .pl-sr,:host.td-markdown::ng-deep .pl-sr .pl-cce,:host.td-markdown::ng-deep .pl-sr .pl-sra,:host.td-markdown::ng-deep .pl-sr .pl-sre{color:#183691}:host.td-markdown::ng-deep .pl-v{color:#ed6a43}:host.td-markdown::ng-deep .pl-id{color:#b52a1d}:host.td-markdown::ng-deep .pl-ii{background-color:#b52a1d;color:#f8f8f8}:host.td-markdown::ng-deep .pl-sr .pl-cce{color:#63a35c;font-weight:700}:host.td-markdown::ng-deep .pl-ml{color:#693a17}:host.td-markdown::ng-deep .pl-mh,:host.td-markdown::ng-deep .pl-mh .pl-en,:host.td-markdown::ng-deep .pl-ms{color:#1d3e81;font-weight:700}:host.td-markdown::ng-deep .pl-mq{color:teal}:host.td-markdown::ng-deep .pl-mi{color:#333;font-style:italic}:host.td-markdown::ng-deep .pl-mb{color:#333;font-weight:700}:host.td-markdown::ng-deep .pl-md{background-color:#ffecec;color:#bd2c00}:host.td-markdown::ng-deep .pl-mi1{background-color:#eaffea;color:#55a532}:host.td-markdown::ng-deep .pl-mdr{color:#795da3;font-weight:700}:host.td-markdown::ng-deep .pl-mo{color:#1d3e81}:host.td-markdown::ng-deep kbd{display:inline-block;padding:3px 5px;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #cccccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px #bbb}:host.td-markdown::ng-deep .full-commit .btn-outline:not(:disabled):hover{color:#4078c0;border:1px solid #4078c0}:host.td-markdown::ng-deep :checked+.radio-label{position:relative;z-index:1;border-color:#4078c0}:host.td-markdown::ng-deep .octicon{display:inline-block;vertical-align:text-top;fill:currentColor}:host.td-markdown::ng-deep .task-list-item{list-style-type:none}:host.td-markdown::ng-deep .task-list-item+.task-list-item{margin-top:3px}:host.td-markdown::ng-deep .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}\n"] }]
|
|
399
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: i0.NgZone }]; }, propDecorators: { class: [{
|
|
393
400
|
type: HostBinding,
|
|
394
401
|
args: ['class']
|
|
395
402
|
}], content: [{
|
|
396
|
-
type: Input
|
|
397
|
-
args: ['content']
|
|
403
|
+
type: Input
|
|
398
404
|
}], simpleLineBreaks: [{
|
|
399
|
-
type: Input
|
|
400
|
-
args: ['simpleLineBreaks']
|
|
405
|
+
type: Input
|
|
401
406
|
}], hostedUrl: [{
|
|
402
|
-
type: Input
|
|
403
|
-
args: ['hostedUrl']
|
|
407
|
+
type: Input
|
|
404
408
|
}], anchor: [{
|
|
405
|
-
type: Input
|
|
406
|
-
args: ['anchor']
|
|
409
|
+
type: Input
|
|
407
410
|
}], contentReady: [{
|
|
408
411
|
type: Output
|
|
409
|
-
}] });
|
|
410
|
-
})();
|
|
412
|
+
}] } });
|
|
411
413
|
|
|
412
414
|
class TdMarkdownLoaderService {
|
|
413
415
|
constructor(_http, _sanitizer) {
|
|
@@ -415,8 +417,9 @@ class TdMarkdownLoaderService {
|
|
|
415
417
|
this._sanitizer = _sanitizer;
|
|
416
418
|
}
|
|
417
419
|
load(url, httpOptions = {}) {
|
|
420
|
+
var _a, _b, _c;
|
|
418
421
|
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
-
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, url);
|
|
422
|
+
const sanitizedUrl = (_a = this._sanitizer.sanitize(SecurityContext.URL, url)) !== null && _a !== void 0 ? _a : '';
|
|
420
423
|
let urlToGet = sanitizedUrl;
|
|
421
424
|
if (isGithubHref(sanitizedUrl)) {
|
|
422
425
|
urlToGet = rawGithubHref(sanitizedUrl);
|
|
@@ -424,9 +427,10 @@ class TdMarkdownLoaderService {
|
|
|
424
427
|
const response = yield this._http
|
|
425
428
|
.get(urlToGet, Object.assign(Object.assign({}, httpOptions), { responseType: 'text', observe: 'response' }))
|
|
426
429
|
.toPromise();
|
|
427
|
-
const contentType = response.headers.get('Content-Type');
|
|
428
|
-
if (contentType.includes('text/plain') ||
|
|
429
|
-
|
|
430
|
+
const contentType = (_b = response === null || response === void 0 ? void 0 : response.headers.get('Content-Type')) !== null && _b !== void 0 ? _b : '';
|
|
431
|
+
if (contentType.includes('text/plain') ||
|
|
432
|
+
contentType.includes('text/markdown')) {
|
|
433
|
+
return (_c = response === null || response === void 0 ? void 0 : response.body) !== null && _c !== void 0 ? _c : '';
|
|
430
434
|
}
|
|
431
435
|
else {
|
|
432
436
|
throw Error(`${contentType} is not a handled content type`);
|
|
@@ -434,21 +438,18 @@ class TdMarkdownLoaderService {
|
|
|
434
438
|
});
|
|
435
439
|
}
|
|
436
440
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
(
|
|
440
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdMarkdownLoaderService, [{
|
|
441
|
+
TdMarkdownLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownLoaderService, deps: [{ token: i1$1.HttpClient }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
442
|
+
TdMarkdownLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownLoaderService });
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownLoaderService, decorators: [{
|
|
441
444
|
type: Injectable
|
|
442
|
-
}], function () { return [{ type: i1$1.HttpClient }, { type: i1.DomSanitizer }]; }
|
|
443
|
-
})();
|
|
445
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i1.DomSanitizer }]; } });
|
|
444
446
|
|
|
445
447
|
class CovalentMarkdownModule {
|
|
446
448
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
(
|
|
451
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentMarkdownModule, [{
|
|
449
|
+
CovalentMarkdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
450
|
+
CovalentMarkdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, declarations: [TdMarkdownComponent], imports: [CommonModule, HttpClientModule], exports: [TdMarkdownComponent] });
|
|
451
|
+
CovalentMarkdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, providers: [TdMarkdownLoaderService], imports: [[CommonModule, HttpClientModule]] });
|
|
452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, decorators: [{
|
|
452
453
|
type: NgModule,
|
|
453
454
|
args: [{
|
|
454
455
|
imports: [CommonModule, HttpClientModule],
|
|
@@ -456,9 +457,7 @@ class CovalentMarkdownModule {
|
|
|
456
457
|
exports: [TdMarkdownComponent],
|
|
457
458
|
providers: [TdMarkdownLoaderService],
|
|
458
459
|
}]
|
|
459
|
-
}]
|
|
460
|
-
})();
|
|
461
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentMarkdownModule, { declarations: [TdMarkdownComponent], imports: [CommonModule, HttpClientModule], exports: [TdMarkdownComponent] }); })();
|
|
460
|
+
}] });
|
|
462
461
|
|
|
463
462
|
/**
|
|
464
463
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"covalent-markdown.mjs","sources":["../../../../src/platform/markdown/markdown-utils/markdown-utils.ts","../../../../src/platform/markdown/markdown.component.ts","../../../../src/platform/markdown/markdown.component.html","../../../../src/platform/markdown/markdown-loader/markdown-loader.service.ts","../../../../src/platform/markdown/markdown.module.ts","../../../../src/platform/markdown/covalent-markdown.ts"],"sourcesContent":["export function removeLeadingHash(str: string): string {\n if (str) {\n return str.replace(/^#+/, '');\n }\n return '';\n}\n\nexport function removeTrailingHash(str: string): string {\n if (str) {\n return str.replace(/\\#.*/, '');\n }\n return '';\n}\n\nexport function genHeadingId(str: string): string {\n if (str) {\n return removeLeadingHash(\n str\n .replace(/(_|-|\\s)+/g, '')\n // Remove certain special chars to create heading ids similar to those in github\n // borrowed from showdown\n // https://github.com/showdownjs/showdown/blob/develop/src/subParsers/makehtml/headers.js#L94\n .replace(/[&+$,\\/:;=?@\"#{}|^¨~\\[\\]`\\\\*)(%.!'<>]/g, ''),\n ).toLowerCase();\n }\n return '';\n}\n\nexport function scrollToAnchor(scope: HTMLElement, anchor: string, tryParent: boolean): boolean {\n if (scope && anchor) {\n const normalizedAnchor: string = genHeadingId(anchor);\n let headingToJumpTo: HTMLElement;\n const headingWithinComponent: HTMLElement = scope.querySelector(`[id=\"${normalizedAnchor}\"]`);\n\n if (headingWithinComponent) {\n headingToJumpTo = headingWithinComponent;\n } else if (tryParent) {\n const parent: HTMLElement = scope.parentElement;\n if (parent) {\n headingToJumpTo = parent.querySelector(`[id=\"${normalizedAnchor}\"]`);\n }\n }\n if (headingToJumpTo) {\n headingToJumpTo.scrollIntoView({ behavior: 'auto' });\n return true;\n }\n }\n return false;\n}\n\nexport function isAnchorLink(anchor: HTMLAnchorElement): boolean {\n if (anchor) {\n const href: string = anchor.getAttribute('href');\n if (href) {\n return href.startsWith('#');\n }\n }\n return false;\n}\nconst RAW_GITHUB_HOSTNAME: string = 'raw.githubusercontent.com';\n\nexport function rawGithubHref(githubHref: string): string {\n if (githubHref) {\n try {\n const url: URL = new URL(githubHref);\n if (url.hostname === RAW_GITHUB_HOSTNAME) {\n return url.href;\n } else if (isGithubHref(githubHref)) {\n url.hostname = RAW_GITHUB_HOSTNAME;\n url.pathname = url.pathname.split('/blob', 2).join('');\n return url.href;\n }\n } catch {\n return '';\n }\n }\n return '';\n}\n\nexport function isGithubHref(href: string): boolean {\n try {\n const temp: URL = new URL(href);\n return temp.hostname === 'github.com';\n } catch {\n return false;\n }\n}\n\nexport function isRawGithubHref(href: string): boolean {\n try {\n const temp: URL = new URL(href);\n return temp.hostname === RAW_GITHUB_HOSTNAME;\n } catch {\n return false;\n }\n}\n\nexport function renderVideoElements(html: string): string {\n const ytLongEmbed: RegExp =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:embed\\/)([\\w-]{11})(\\?[\\w%;-]+(?:=[\\w%;-]+)?(?:&[\\w%;-]+(?:=[\\w%;-]+)?)*)?)]/gi;\n const ytLongWatch: RegExp =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:watch\\?v=)([\\w-]{11})(&[\\w%;-]+(?:=[\\w%;-]+)?)*)]/gi;\n const ytShort: RegExp =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)?youtu.be\\/([\\w-]{11})\\??([\\w%;-]+(?:=[\\w%;-]+)?(?:&[\\w%;-]+(?:=[\\w%;-]+)?)*)?]/gi;\n const ytPlaylist: RegExp =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:playlist\\?list=)([\\w-]{34})(&[\\w%;-]+(?:=[\\w%;-]+)?)*)]/gi;\n\n function convert(match: string, id: string, flags: string): string {\n if (flags) {\n id += '?' + flags.replace(/&/gi, '&');\n }\n return `<iframe allow=\"fullscreen\" frameborder=\"0\" src=\"https://www.youtube.com/embed/${id}\"></iframe>`;\n }\n function convertPL(match: string, id: string, flags: string): string {\n if (flags) {\n id += flags.replace(/&/gi, '&');\n }\n return `<iframe allow=\"fullscreen\" frameborder=\"0\" src=\"https://www.youtube.com/embed/videoseries?list=${id}\"></iframe>`;\n }\n\n return html\n .replace(ytLongWatch, convert)\n .replace(ytLongEmbed, convert)\n .replace(ytShort, convert)\n .replace(ytPlaylist, convertPL);\n}\n","import {\n Component,\n AfterViewInit,\n ElementRef,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n SecurityContext,\n OnChanges,\n SimpleChanges,\n HostBinding,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport {\n scrollToAnchor,\n genHeadingId,\n isAnchorLink,\n removeTrailingHash,\n rawGithubHref,\n isGithubHref,\n isRawGithubHref,\n renderVideoElements,\n} from './markdown-utils/markdown-utils';\n\ndeclare const require: any;\n/* tslint:disable-next-line */\nlet showdown: any = require('showdown/dist/showdown.js');\n\n// TODO: assumes it is a github url\n// allow override somehow\nfunction generateAbsoluteHref(currentHref: string, relativeHref: string): string {\n if (currentHref && relativeHref) {\n const currentUrl: URL = new URL(currentHref);\n const path: string = currentUrl.pathname.split('/').slice(1, -1).join('/');\n const correctUrl: URL = new URL(currentHref);\n\n if (relativeHref.startsWith('/')) {\n // url is relative to top level\n const orgAndRepo: string = path.split('/').slice(0, 3).join('/');\n correctUrl.pathname = `${orgAndRepo}${relativeHref}`;\n } else {\n correctUrl.pathname = `${path}/${relativeHref}`;\n }\n return correctUrl.href;\n }\n return undefined;\n}\n\nfunction normalizeHtmlHrefs(html: string, currentHref: string): string {\n if (currentHref) {\n const document: Document = new DOMParser().parseFromString(html, 'text/html');\n document.querySelectorAll('a[href]').forEach((link: HTMLAnchorElement) => {\n const url: URL = new URL(link.href);\n const originalHash: string = url.hash;\n if (isAnchorLink(link)) {\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n link.href = url.hash;\n }\n } else if (url.host === window.location.host) {\n // hosts match, meaning URL MIGHT have been malformed by showdown\n // url is a relative url or just a link to a part of the application\n if (url.pathname.endsWith('.md')) {\n // only check .md urls\n\n const hrefWithoutHash: string = removeTrailingHash(link.getAttribute('href'));\n\n url.href = generateAbsoluteHref(currentHref, hrefWithoutHash);\n\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n }\n link.href = url.href;\n }\n link.target = '_blank';\n } else {\n // url is absolute\n if (url.pathname.endsWith('.md')) {\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n }\n link.href = url.href;\n }\n link.target = '_blank';\n }\n });\n\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\nfunction normalizeImageSrcs(html: string, currentHref: string): string {\n if (currentHref) {\n const document: Document = new DOMParser().parseFromString(html, 'text/html');\n document.querySelectorAll('img[src]').forEach((image: HTMLImageElement) => {\n const src: string = image.getAttribute('src');\n try {\n /* tslint:disable-next-line:no-unused-expression */\n new URL(src);\n if (isGithubHref(src)) {\n image.src = rawGithubHref(src);\n }\n } catch {\n image.src = generateAbsoluteHref(isGithubHref(currentHref) ? rawGithubHref(currentHref) : currentHref, src);\n }\n // gh svgs need to have ?sanitize=true\n if (isRawGithubHref(image.src)) {\n const url: URL = new URL(image.src);\n if (url.pathname.endsWith('.svg')) {\n url.searchParams.set('sanitize', 'true');\n image.src = url.href;\n }\n }\n });\n\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\nfunction addIdsToHeadings(html: string): string {\n if (html) {\n const document: Document = new DOMParser().parseFromString(html, 'text/html');\n document.querySelectorAll('h1, h2, h3, h4, h5, h6').forEach((heading: HTMLElement) => {\n const id: string = genHeadingId(heading.innerHTML);\n heading.setAttribute('id', id);\n });\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\n@Component({\n selector: 'td-markdown',\n styleUrls: ['./markdown.component.scss'],\n templateUrl: './markdown.component.html',\n})\nexport class TdMarkdownComponent implements OnChanges, AfterViewInit, OnDestroy {\n private _content: string;\n private _simpleLineBreaks: boolean = false;\n private _hostedUrl: string;\n private _anchor: string;\n private _viewInit: boolean = false;\n private _anchorListener?: VoidFunction;\n /**\n * .td-markdown class added to host so ::ng-deep gets scoped.\n */\n @HostBinding('class') class: string = 'td-markdown';\n\n /**\n * content?: string\n *\n * Markdown format content to be parsed as html markup.\n *\n * e.g. README.md content.\n */\n @Input('content')\n set content(content: string) {\n this._content = content;\n }\n\n /**\n * simpleLineBreaks?: string\n *\n * Sets whether newline characters inside paragraphs and spans are parsed as <br/>.\n * Defaults to false.\n */\n @Input('simpleLineBreaks')\n set simpleLineBreaks(simpleLineBreaks: boolean) {\n this._simpleLineBreaks = simpleLineBreaks;\n }\n\n /**\n * hostedUrl?: string\n *\n * If markdown contains relative paths, this is required to generate correct urls.\n *\n */\n @Input('hostedUrl')\n set hostedUrl(hostedUrl: string) {\n this._hostedUrl = hostedUrl;\n }\n\n /**\n * anchor?: string\n *\n * Anchor to jump to.\n *\n */\n @Input('anchor')\n set anchor(anchor: string) {\n this._anchor = anchor;\n }\n\n /**\n * contentReady?: function\n * Event emitted after the markdown content rendering is finished.\n */\n @Output() contentReady: EventEmitter<undefined> = new EventEmitter<undefined>();\n\n constructor(\n private _renderer: Renderer2,\n private _elementRef: ElementRef,\n private _domSanitizer: DomSanitizer,\n private _ngZone: NgZone,\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n // only anchor changed\n if (changes.anchor && !changes.content && !changes.simpleLineBreaks && !changes.hostedUrl) {\n scrollToAnchor(this._elementRef.nativeElement, this._anchor, true);\n } else {\n this.refresh();\n }\n }\n\n ngAfterViewInit(): void {\n if (!this._content) {\n this._loadContent((<HTMLElement>this._elementRef.nativeElement).textContent);\n }\n this._viewInit = true;\n\n // Caretaker note: the `scrollToAnchor` calls `element.scrollIntoView`, a native synchronous DOM\n // API and it doesn't require Angular running `ApplicationRef.tick()` each time the markdown component is clicked.\n // Host listener (added through `@HostListener`) cause Angular to add an event listener within the Angular zone.\n // It also calls `markViewDirty()` before calling the actual listener (the decorated class method).\n this._ngZone.runOutsideAngular(() => {\n this._anchorListener = this._renderer.listen(this._elementRef.nativeElement, 'click', (event: MouseEvent) => {\n const element: HTMLElement = <HTMLElement>event.srcElement;\n if (element.matches('a[href]') && isAnchorLink(<HTMLAnchorElement>element)) {\n this.handleAnchorClicks(event);\n }\n });\n });\n }\n\n ngOnDestroy(): void {\n this._anchorListener?.();\n }\n\n refresh(): void {\n if (this._content) {\n this._loadContent(this._content);\n } else if (this._viewInit) {\n this._loadContent((<HTMLElement>this._elementRef.nativeElement).textContent);\n }\n }\n\n /**\n * General method to parse a string markdown into HTML Elements and load them into the container\n */\n private _loadContent(markdown: string): void {\n if (markdown && markdown.trim().length > 0) {\n // Clean container\n this._renderer.setProperty(this._elementRef.nativeElement, 'innerHTML', '');\n // Parse html string into actual HTML elements.\n this._elementFromString(this._render(markdown));\n }\n // TODO: timeout required since resizing of html elements occurs which causes a change in the scroll position\n setTimeout(() => scrollToAnchor(this._elementRef.nativeElement, this._anchor, true), 250);\n this.contentReady.emit();\n }\n\n private handleAnchorClicks(event: Event): void {\n event.preventDefault();\n const url: URL = new URL((<HTMLAnchorElement>event.target).href);\n const hash: string = decodeURI(url.hash);\n scrollToAnchor(this._elementRef.nativeElement, hash, true);\n }\n\n private _elementFromString(markupStr: string): HTMLDivElement {\n // Renderer2 doesnt have a parsing method, so we have to sanitize and use [innerHTML]\n // to parse the string into DOM element for now.\n const div: HTMLDivElement = this._renderer.createElement('div');\n this._renderer.appendChild(this._elementRef.nativeElement, div);\n const html: string = this._domSanitizer.sanitize(SecurityContext.HTML, markupStr);\n const htmlWithAbsoluteHrefs: string = normalizeHtmlHrefs(html, this._hostedUrl);\n const htmlWithAbsoluteImgSrcs: string = normalizeImageSrcs(htmlWithAbsoluteHrefs, this._hostedUrl);\n const htmlWithHeadingIds: string = addIdsToHeadings(htmlWithAbsoluteImgSrcs);\n const htmlWithVideos: SafeHtml = renderVideoElements(htmlWithHeadingIds);\n this._renderer.setProperty(div, 'innerHTML', htmlWithVideos);\n return div;\n }\n\n private _render(markdown: string): string {\n // Trim leading and trailing newlines\n markdown = markdown.replace(/^(\\s|\\t)*\\n+/g, '').replace(/(\\s|\\t)*\\n+(\\s|\\t)*$/g, '');\n // Split markdown by line characters\n let lines: string[] = markdown.split('\\n');\n\n // check how much indentation is used by the first actual markdown line\n const firstLineWhitespace: string = lines[0].match(/^(\\s|\\t)*/)[0];\n\n // Remove all indentation spaces so markdown can be parsed correctly\n const startingWhitespaceRegex: RegExp = new RegExp('^' + firstLineWhitespace);\n lines = lines.map(function (line: string): string {\n return line.replace(startingWhitespaceRegex, '');\n });\n\n // Join lines again with line characters\n const markdownToParse: string = lines.join('\\n');\n\n // Convert markdown into html\n const converter: any = new showdown.Converter();\n converter.setOption('ghCodeBlocks', true);\n converter.setOption('tasklists', true);\n converter.setOption('tables', true);\n converter.setOption('literalMidWordUnderscores', true);\n converter.setOption('simpleLineBreaks', this._simpleLineBreaks);\n return converter.makeHtml(markdownToParse);\n }\n}\n","<ng-content></ng-content>\n","import { Injectable, SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { HttpClient, HttpResponse } from '@angular/common/http';\nimport { isGithubHref, rawGithubHref } from '../markdown-utils/markdown-utils';\n\n@Injectable()\nexport class TdMarkdownLoaderService {\n constructor(private _http: HttpClient, private _sanitizer: DomSanitizer) {}\n\n async load(url: string, httpOptions: object = {}): Promise<string> {\n const sanitizedUrl: string = this._sanitizer.sanitize(SecurityContext.URL, url);\n let urlToGet: string = sanitizedUrl;\n if (isGithubHref(sanitizedUrl)) {\n urlToGet = rawGithubHref(sanitizedUrl);\n }\n\n const response: HttpResponse<string> = await this._http\n .get(urlToGet, { ...httpOptions, responseType: 'text', observe: 'response' })\n .toPromise();\n const contentType: string = response.headers.get('Content-Type');\n if (contentType.includes('text/plain') || contentType.includes('text/markdown')) {\n return response.body;\n } else {\n throw Error(`${contentType} is not a handled content type`);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { HttpClientModule } from '@angular/common/http';\n\nimport { TdMarkdownComponent } from './markdown.component';\nimport { TdMarkdownLoaderService } from './markdown-loader/markdown-loader.service';\n\n@NgModule({\n imports: [CommonModule, HttpClientModule],\n declarations: [TdMarkdownComponent],\n exports: [TdMarkdownComponent],\n providers: [TdMarkdownLoaderService],\n})\nexport class CovalentMarkdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAAgB,iBAAiB,CAAC,GAAW;IAC3C,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KAC/B;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;SAEe,kBAAkB,CAAC,GAAW;IAC5C,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;KAChC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;SAEe,YAAY,CAAC,GAAW;IACtC,IAAI,GAAG,EAAE;QACP,OAAO,iBAAiB,CACtB,GAAG;aACA,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;;;;aAIzB,OAAO,CAAC,wCAAwC,EAAE,EAAE,CAAC,CACzD,CAAC,WAAW,EAAE,CAAC;KACjB;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;SAEe,cAAc,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AAM,KAAK,CAAC,GAAG,WAAW,gCAAgC,CAAC,CAAC;aAC7D;SACF;KAAA;;oIAnBU,uBAAuB;+HAAvB,uBAAuB,WAAvB,uBAAuB;;4EAAvB,uBAAuB;kBADnC,UAAU;;;;MCSE,sBAAsB;;kIAAtB,sBAAsB;0HAAtB,sBAAsB;+HAFtB,CAAC,uBAAuB,CAAC,YAH3B,CAAC,YAAY,EAAE,gBAAgB,CAAC;;4EAK9B,sBAAsB;kBANlC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;oBACzC,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC;;;wFACY,sBAAsB,mBAJlB,mBAAmB,aADxB,YAAY,EAAE,gBAAgB,aAE9B,mBAAmB;;ACX/B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"covalent-markdown.mjs","sources":["../../../../libs/markdown/src/lib/markdown-utils/markdown-utils.ts","../../../../libs/markdown/src/lib/markdown.component.ts","../../../../libs/markdown/src/lib/markdown.component.html","../../../../libs/markdown/src/lib/markdown-loader/markdown-loader.service.ts","../../../../libs/markdown/src/lib/markdown.module.ts","../../../../libs/markdown/src/covalent-markdown.ts"],"sourcesContent":["export function removeLeadingHash(str: string): string {\n if (str) {\n return str.replace(/^#+/, '');\n }\n return '';\n}\n\nexport function removeTrailingHash(str: string | null): string {\n if (str) {\n return str.replace(/#.*/, '');\n }\n return '';\n}\n\nexport function genHeadingId(str: string): string {\n if (str) {\n return removeLeadingHash(\n str\n .replace(/(_|-|\\s)+/g, '')\n // Remove certain special chars to create heading ids similar to those in github\n // borrowed from showdown\n // https://github.com/showdownjs/showdown/blob/develop/src/subParsers/makehtml/headers.js#L94\n .replace(/[&+$,/:;=?@\"#{}|^¨~[\\]`\\\\*)(%.!'<>]/g, '')\n ).toLowerCase();\n }\n return '';\n}\n\nexport function scrollToAnchor(\n scope: HTMLElement,\n anchor: string,\n tryParent: boolean\n): boolean {\n if (scope && anchor) {\n const normalizedAnchor: string = genHeadingId(anchor);\n let headingToJumpTo: Element | null = null;\n const headingWithinComponent = scope.querySelector(\n `[id=\"${normalizedAnchor}\"]`\n );\n\n if (headingWithinComponent) {\n headingToJumpTo = headingWithinComponent;\n } else if (tryParent) {\n const parent = scope.parentElement;\n if (parent) {\n headingToJumpTo = parent.querySelector(`[id=\"${normalizedAnchor}\"]`);\n }\n }\n if (headingToJumpTo) {\n headingToJumpTo.scrollIntoView({ behavior: 'auto' });\n return true;\n }\n }\n return false;\n}\n\nexport function isAnchorLink(anchor?: HTMLAnchorElement): boolean {\n if (anchor) {\n const href = anchor.getAttribute('href');\n if (href) {\n return href.startsWith('#');\n }\n }\n return false;\n}\nconst RAW_GITHUB_HOSTNAME = 'raw.githubusercontent.com';\n\nexport function rawGithubHref(githubHref?: string): string {\n if (githubHref) {\n try {\n const url: URL = new URL(githubHref);\n if (url.hostname === RAW_GITHUB_HOSTNAME) {\n return url.href;\n } else if (isGithubHref(githubHref)) {\n url.hostname = RAW_GITHUB_HOSTNAME;\n url.pathname = url.pathname.split('/blob', 2).join('');\n return url.href;\n }\n } catch {\n return '';\n }\n }\n return '';\n}\n\nexport function isGithubHref(href?: string): boolean {\n try {\n const temp: URL = new URL(href ?? '');\n return temp.hostname === 'github.com';\n } catch {\n return false;\n }\n}\n\nexport function isRawGithubHref(href: string = ''): boolean {\n try {\n const temp: URL = new URL(href);\n return temp.hostname === RAW_GITHUB_HOSTNAME;\n } catch {\n return false;\n }\n}\n\nexport function renderVideoElements(html: string): string {\n const ytLongEmbed =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:embed\\/)([\\w-]{11})(\\?[\\w%;-]+(?:=[\\w%;-]+)?(?:&[\\w%;-]+(?:=[\\w%;-]+)?)*)?)]/gi;\n const ytLongWatch =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:watch\\?v=)([\\w-]{11})(&[\\w%;-]+(?:=[\\w%;-]+)?)*)]/gi;\n const ytShort =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)?youtu.be\\/([\\w-]{11})\\??([\\w%;-]+(?:=[\\w%;-]+)?(?:&[\\w%;-]+(?:=[\\w%;-]+)?)*)?]/gi;\n const ytPlaylist =\n /!\\[(?:(?:https?:)?(?:\\/\\/)?)(?:(?:www)?.)?youtube.(?:.+?)\\/(?:(?:playlist\\?list=)([\\w-]{34})(&[\\w%;-]+(?:=[\\w%;-]+)?)*)]/gi;\n\n function convert(match: string, id: string, flags: string): string {\n if (flags) {\n id += '?' + flags.replace(/&/gi, '&');\n }\n return `<iframe allow=\"fullscreen\" frameborder=\"0\" src=\"https://www.youtube.com/embed/${id}\"></iframe>`;\n }\n function convertPL(match: string, id: string, flags: string): string {\n if (flags) {\n id += flags.replace(/&/gi, '&');\n }\n return `<iframe allow=\"fullscreen\" frameborder=\"0\" src=\"https://www.youtube.com/embed/videoseries?list=${id}\"></iframe>`;\n }\n\n return html\n .replace(ytLongWatch, convert)\n .replace(ytLongEmbed, convert)\n .replace(ytShort, convert)\n .replace(ytPlaylist, convertPL);\n}\n","import {\n Component,\n AfterViewInit,\n ElementRef,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n SecurityContext,\n OnChanges,\n SimpleChanges,\n HostBinding,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport {\n scrollToAnchor,\n genHeadingId,\n isAnchorLink,\n removeTrailingHash,\n rawGithubHref,\n isGithubHref,\n isRawGithubHref,\n renderVideoElements,\n} from './markdown-utils/markdown-utils';\n\nimport * as showdown from 'showdown';\n\n// TODO: assumes it is a github url\n// allow override somehow\nfunction generateAbsoluteHref(\n currentHref: string,\n relativeHref: string\n): string {\n if (currentHref && relativeHref) {\n const currentUrl: URL = new URL(currentHref);\n const path: string = currentUrl.pathname.split('/').slice(1, -1).join('/');\n const correctUrl: URL = new URL(currentHref);\n\n if (relativeHref.startsWith('/')) {\n // url is relative to top level\n const orgAndRepo: string = path.split('/').slice(0, 3).join('/');\n correctUrl.pathname = `${orgAndRepo}${relativeHref}`;\n } else {\n correctUrl.pathname = `${path}/${relativeHref}`;\n }\n return correctUrl.href;\n }\n return '';\n}\n\nfunction normalizeHtmlHrefs(html: string, currentHref: string): string {\n if (currentHref) {\n const document: Document = new DOMParser().parseFromString(\n html,\n 'text/html'\n );\n document\n .querySelectorAll<HTMLAnchorElement>('a[href]')\n .forEach((link: HTMLAnchorElement) => {\n const url: URL = new URL(link.href);\n const originalHash: string = url.hash;\n if (isAnchorLink(link)) {\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n link.href = url.hash;\n }\n } else if (url.host === window.location.host) {\n // hosts match, meaning URL MIGHT have been malformed by showdown\n // url is a relative url or just a link to a part of the application\n if (url.pathname.endsWith('.md')) {\n // only check .md urls\n\n const hrefWithoutHash: string = removeTrailingHash(\n link.getAttribute('href')\n );\n\n url.href = generateAbsoluteHref(currentHref, hrefWithoutHash);\n\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n }\n link.href = url.href;\n }\n link.target = '_blank';\n } else {\n // url is absolute\n if (url.pathname.endsWith('.md')) {\n if (originalHash) {\n url.hash = genHeadingId(originalHash);\n }\n link.href = url.href;\n }\n link.target = '_blank';\n }\n });\n\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\nfunction normalizeImageSrcs(html: string, currentHref: string): string {\n if (currentHref) {\n const document: Document = new DOMParser().parseFromString(\n html,\n 'text/html'\n );\n document\n .querySelectorAll<HTMLImageElement>('img[src]')\n .forEach((image: HTMLImageElement) => {\n const src = image.getAttribute('src') ?? '';\n try {\n /* tslint:disable-next-line:no-unused-expression */\n new URL(src);\n if (isGithubHref(src)) {\n image.src = rawGithubHref(src);\n }\n } catch {\n image.src = generateAbsoluteHref(\n isGithubHref(currentHref)\n ? rawGithubHref(currentHref)\n : currentHref,\n src\n );\n }\n // gh svgs need to have ?sanitize=true\n if (isRawGithubHref(image.src)) {\n const url: URL = new URL(image.src);\n if (url.pathname.endsWith('.svg')) {\n url.searchParams.set('sanitize', 'true');\n image.src = url.href;\n }\n }\n });\n\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\nfunction addIdsToHeadings(html: string): string {\n if (html) {\n const document: Document = new DOMParser().parseFromString(\n html,\n 'text/html'\n );\n document\n .querySelectorAll('h1, h2, h3, h4, h5, h6')\n .forEach((heading: Element) => {\n const id: string = genHeadingId(heading.innerHTML);\n heading.setAttribute('id', id);\n });\n return new XMLSerializer().serializeToString(document);\n }\n return html;\n}\n\n@Component({\n selector: 'td-markdown',\n styleUrls: ['./markdown.component.scss'],\n templateUrl: './markdown.component.html',\n})\nexport class TdMarkdownComponent\n implements OnChanges, AfterViewInit, OnDestroy\n{\n private _content!: string;\n private _simpleLineBreaks = false;\n private _hostedUrl!: string;\n private _anchor!: string;\n private _viewInit = false;\n private _anchorListener?: VoidFunction;\n /**\n * .td-markdown class added to host so ::ng-deep gets scoped.\n */\n @HostBinding('class') class = 'td-markdown';\n\n /**\n * content?: string\n *\n * Markdown format content to be parsed as html markup.\n *\n * e.g. README.md content.\n */\n @Input()\n set content(content: string) {\n this._content = content;\n }\n\n /**\n * simpleLineBreaks?: string\n *\n * Sets whether newline characters inside paragraphs and spans are parsed as <br/>.\n * Defaults to false.\n */\n @Input()\n set simpleLineBreaks(simpleLineBreaks: boolean) {\n this._simpleLineBreaks = simpleLineBreaks;\n }\n\n /**\n * hostedUrl?: string\n *\n * If markdown contains relative paths, this is required to generate correct urls.\n *\n */\n @Input()\n set hostedUrl(hostedUrl: string) {\n this._hostedUrl = hostedUrl;\n }\n\n /**\n * anchor?: string\n *\n * Anchor to jump to.\n *\n */\n @Input()\n set anchor(anchor: string) {\n this._anchor = anchor;\n }\n\n /**\n * contentReady?: function\n * Event emitted after the markdown content rendering is finished.\n */\n @Output() contentReady: EventEmitter<undefined> =\n new EventEmitter<undefined>();\n\n constructor(\n private _renderer: Renderer2,\n private _elementRef: ElementRef,\n private _domSanitizer: DomSanitizer,\n private _ngZone: NgZone\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n // only anchor changed\n if (\n changes['anchor'] &&\n !changes['content'] &&\n !changes['simpleLineBreaks'] &&\n !changes['hostedUrl']\n ) {\n scrollToAnchor(this._elementRef.nativeElement, this._anchor, true);\n } else {\n this.refresh();\n }\n }\n\n ngAfterViewInit(): void {\n if (!this._content) {\n this._loadContent(\n (<HTMLElement>this._elementRef.nativeElement).textContent\n );\n }\n this._viewInit = true;\n\n // Caretaker note: the `scrollToAnchor` calls `element.scrollIntoView`, a native synchronous DOM\n // API and it doesn't require Angular running `ApplicationRef.tick()` each time the markdown component is clicked.\n // Host listener (added through `@HostListener`) cause Angular to add an event listener within the Angular zone.\n // It also calls `markViewDirty()` before calling the actual listener (the decorated class method).\n this._ngZone.runOutsideAngular(() => {\n this._anchorListener = this._renderer.listen(\n this._elementRef.nativeElement,\n 'click',\n (event: MouseEvent) => {\n const element: HTMLElement = <HTMLElement>event.srcElement;\n if (\n element.matches('a[href]') &&\n isAnchorLink(<HTMLAnchorElement>element)\n ) {\n this.handleAnchorClicks(event);\n }\n }\n );\n });\n }\n\n ngOnDestroy(): void {\n this._anchorListener?.();\n }\n\n refresh(): void {\n if (this._content) {\n this._loadContent(this._content);\n } else if (this._viewInit) {\n this._loadContent(\n (<HTMLElement>this._elementRef.nativeElement).textContent\n );\n }\n }\n\n /**\n * General method to parse a string markdown into HTML Elements and load them into the container\n */\n private _loadContent(markdown: string | null): void {\n if (markdown && markdown.trim().length > 0) {\n // Clean container\n this._renderer.setProperty(\n this._elementRef.nativeElement,\n 'innerHTML',\n ''\n );\n // Parse html string into actual HTML elements.\n this._elementFromString(this._render(markdown));\n }\n // TODO: timeout required since resizing of html elements occurs which causes a change in the scroll position\n setTimeout(\n () => scrollToAnchor(this._elementRef.nativeElement, this._anchor, true),\n 250\n );\n this.contentReady.emit();\n }\n\n private handleAnchorClicks(event: Event): void {\n event.preventDefault();\n const url: URL = new URL((<HTMLAnchorElement>event.target).href);\n const hash: string = decodeURI(url.hash);\n scrollToAnchor(this._elementRef.nativeElement, hash, true);\n }\n\n private _elementFromString(markupStr: string): HTMLDivElement {\n // Renderer2 doesnt have a parsing method, so we have to sanitize and use [innerHTML]\n // to parse the string into DOM element for now.\n const div: HTMLDivElement = this._renderer.createElement('div');\n this._renderer.appendChild(this._elementRef.nativeElement, div);\n const html: string =\n this._domSanitizer.sanitize(SecurityContext.HTML, markupStr) ?? '';\n const htmlWithAbsoluteHrefs: string = normalizeHtmlHrefs(\n html,\n this._hostedUrl\n );\n const htmlWithAbsoluteImgSrcs: string = normalizeImageSrcs(\n htmlWithAbsoluteHrefs,\n this._hostedUrl\n );\n const htmlWithHeadingIds: string = addIdsToHeadings(\n htmlWithAbsoluteImgSrcs\n );\n const htmlWithVideos: SafeHtml = renderVideoElements(htmlWithHeadingIds);\n this._renderer.setProperty(div, 'innerHTML', htmlWithVideos);\n return div;\n }\n\n private _render(markdown: string): string {\n // Trim leading and trailing newlines\n markdown = markdown\n .replace(/^(\\s|\\t)*\\n+/g, '')\n .replace(/(\\s|\\t)*\\n+(\\s|\\t)*$/g, '');\n // Split markdown by line characters\n let lines: string[] = markdown.split('\\n');\n\n // check how much indentation is used by the first actual markdown line\n const firstLineWhitespaceMatch = lines[0].match(/^(\\s|\\t)*/);\n const firstLineWhitespace: string = firstLineWhitespaceMatch\n ? firstLineWhitespaceMatch[0]\n : '';\n\n // Remove all indentation spaces so markdown can be parsed correctly\n const startingWhitespaceRegex = new RegExp('^' + firstLineWhitespace);\n lines = lines.map(function (line: string): string {\n return line.replace(startingWhitespaceRegex, '');\n });\n\n // Join lines again with line characters\n const markdownToParse: string = lines.join('\\n');\n\n // Convert markdown into html\n const converter: any = new showdown.Converter();\n converter.setOption('ghCodeBlocks', true);\n converter.setOption('tasklists', true);\n converter.setOption('tables', true);\n converter.setOption('literalMidWordUnderscores', true);\n converter.setOption('simpleLineBreaks', this._simpleLineBreaks);\n return converter.makeHtml(markdownToParse);\n }\n}\n","<ng-content></ng-content>\n","import { Injectable, SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { HttpClient, HttpResponse } from '@angular/common/http';\nimport { isGithubHref, rawGithubHref } from '../markdown-utils/markdown-utils';\n\n@Injectable()\nexport class TdMarkdownLoaderService {\n constructor(private _http: HttpClient, private _sanitizer: DomSanitizer) {}\n\n async load(url: string, httpOptions: object = {}): Promise<string> {\n const sanitizedUrl: string =\n this._sanitizer.sanitize(SecurityContext.URL, url) ?? '';\n let urlToGet: string = sanitizedUrl;\n if (isGithubHref(sanitizedUrl)) {\n urlToGet = rawGithubHref(sanitizedUrl);\n }\n\n const response: HttpResponse<string> | undefined = await this._http\n .get(urlToGet, {\n ...httpOptions,\n responseType: 'text',\n observe: 'response',\n })\n .toPromise();\n const contentType: string = response?.headers.get('Content-Type') ?? '';\n if (\n contentType.includes('text/plain') ||\n contentType.includes('text/markdown')\n ) {\n return response?.body ?? '';\n } else {\n throw Error(`${contentType} is not a handled content type`);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { HttpClientModule } from '@angular/common/http';\n\nimport { TdMarkdownComponent } from './markdown.component';\nimport { TdMarkdownLoaderService } from './markdown-loader/markdown-loader.service';\n\n@NgModule({\n imports: [CommonModule, HttpClientModule],\n declarations: [TdMarkdownComponent],\n exports: [TdMarkdownComponent],\n providers: [TdMarkdownLoaderService],\n})\nexport class CovalentMarkdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;SAAgB,iBAAiB,CAAC,GAAW;IAC3C,IAAI,GAAG,EAAE;QACP,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,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