@covalent/markdown 4.0.0-beta.1 → 4.1.1-beta.3
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/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 +85 -83
- package/fesm2015/covalent-markdown.mjs.map +1 -1
- package/fesm2020/covalent-markdown.mjs +98 -83
- 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} +6 -4
- 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/_markdown-theme.scss +0 -69
- 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 -281
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, SecurityContext, Component, HostBinding, Input, Output,
|
|
2
|
+
import { EventEmitter, SecurityContext, Component, HostBinding, Input, Output, Injectable, NgModule } from '@angular/core';
|
|
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';
|
|
@@ -13,7 +13,7 @@ function removeLeadingHash(str) {
|
|
|
13
13
|
}
|
|
14
14
|
function removeTrailingHash(str) {
|
|
15
15
|
if (str) {
|
|
16
|
-
return str.replace(
|
|
16
|
+
return str.replace(/#.*/, '');
|
|
17
17
|
}
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
@@ -24,14 +24,14 @@ function genHeadingId(str) {
|
|
|
24
24
|
// Remove certain special chars to create heading ids similar to those in github
|
|
25
25
|
// borrowed from showdown
|
|
26
26
|
// https://github.com/showdownjs/showdown/blob/develop/src/subParsers/makehtml/headers.js#L94
|
|
27
|
-
.replace(/[
|
|
27
|
+
.replace(/[&+$,/:;=?@"#{}|^¨~[\]`\\*)(%.!'<>]/g, '')).toLowerCase();
|
|
28
28
|
}
|
|
29
29
|
return '';
|
|
30
30
|
}
|
|
31
31
|
function scrollToAnchor(scope, anchor, tryParent) {
|
|
32
32
|
if (scope && anchor) {
|
|
33
33
|
const normalizedAnchor = genHeadingId(anchor);
|
|
34
|
-
let headingToJumpTo;
|
|
34
|
+
let headingToJumpTo = null;
|
|
35
35
|
const headingWithinComponent = scope.querySelector(`[id="${normalizedAnchor}"]`);
|
|
36
36
|
if (headingWithinComponent) {
|
|
37
37
|
headingToJumpTo = headingWithinComponent;
|
|
@@ -80,14 +80,14 @@ function rawGithubHref(githubHref) {
|
|
|
80
80
|
}
|
|
81
81
|
function isGithubHref(href) {
|
|
82
82
|
try {
|
|
83
|
-
const temp = new URL(href);
|
|
83
|
+
const temp = new URL(href ?? '');
|
|
84
84
|
return temp.hostname === 'github.com';
|
|
85
85
|
}
|
|
86
86
|
catch {
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
function isRawGithubHref(href) {
|
|
90
|
+
function isRawGithubHref(href = '') {
|
|
91
91
|
try {
|
|
92
92
|
const temp = new URL(href);
|
|
93
93
|
return temp.hostname === RAW_GITHUB_HOSTNAME;
|
|
@@ -120,9 +120,7 @@ function renderVideoElements(html) {
|
|
|
120
120
|
.replace(ytPlaylist, convertPL);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const
|
|
124
|
-
/* tslint:disable-next-line */
|
|
125
|
-
let showdown = require('showdown/dist/showdown.js');
|
|
123
|
+
const showdown = require('showdown/dist/showdown.js');
|
|
126
124
|
// TODO: assumes it is a github url
|
|
127
125
|
// allow override somehow
|
|
128
126
|
function generateAbsoluteHref(currentHref, relativeHref) {
|
|
@@ -140,12 +138,14 @@ function generateAbsoluteHref(currentHref, relativeHref) {
|
|
|
140
138
|
}
|
|
141
139
|
return correctUrl.href;
|
|
142
140
|
}
|
|
143
|
-
return
|
|
141
|
+
return '';
|
|
144
142
|
}
|
|
145
143
|
function normalizeHtmlHrefs(html, currentHref) {
|
|
146
144
|
if (currentHref) {
|
|
147
145
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
148
|
-
document
|
|
146
|
+
document
|
|
147
|
+
.querySelectorAll('a[href]')
|
|
148
|
+
.forEach((link) => {
|
|
149
149
|
const url = new URL(link.href);
|
|
150
150
|
const originalHash = url.hash;
|
|
151
151
|
if (isAnchorLink(link)) {
|
|
@@ -186,8 +186,10 @@ function normalizeHtmlHrefs(html, currentHref) {
|
|
|
186
186
|
function normalizeImageSrcs(html, currentHref) {
|
|
187
187
|
if (currentHref) {
|
|
188
188
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
189
|
-
document
|
|
190
|
-
|
|
189
|
+
document
|
|
190
|
+
.querySelectorAll('img[src]')
|
|
191
|
+
.forEach((image) => {
|
|
192
|
+
const src = image.getAttribute('src') ?? '';
|
|
191
193
|
try {
|
|
192
194
|
/* tslint:disable-next-line:no-unused-expression */
|
|
193
195
|
new URL(src);
|
|
@@ -196,7 +198,9 @@ function normalizeImageSrcs(html, currentHref) {
|
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
catch {
|
|
199
|
-
image.src = generateAbsoluteHref(isGithubHref(currentHref)
|
|
201
|
+
image.src = generateAbsoluteHref(isGithubHref(currentHref)
|
|
202
|
+
? rawGithubHref(currentHref)
|
|
203
|
+
: currentHref, src);
|
|
200
204
|
}
|
|
201
205
|
// gh svgs need to have ?sanitize=true
|
|
202
206
|
if (isRawGithubHref(image.src)) {
|
|
@@ -214,7 +218,9 @@ function normalizeImageSrcs(html, currentHref) {
|
|
|
214
218
|
function addIdsToHeadings(html) {
|
|
215
219
|
if (html) {
|
|
216
220
|
const document = new DOMParser().parseFromString(html, 'text/html');
|
|
217
|
-
document
|
|
221
|
+
document
|
|
222
|
+
.querySelectorAll('h1, h2, h3, h4, h5, h6')
|
|
223
|
+
.forEach((heading) => {
|
|
218
224
|
const id = genHeadingId(heading.innerHTML);
|
|
219
225
|
heading.setAttribute('id', id);
|
|
220
226
|
});
|
|
@@ -223,10 +229,11 @@ function addIdsToHeadings(html) {
|
|
|
223
229
|
return html;
|
|
224
230
|
}
|
|
225
231
|
class TdMarkdownComponent {
|
|
226
|
-
constructor(_renderer, _elementRef, _domSanitizer) {
|
|
232
|
+
constructor(_renderer, _elementRef, _domSanitizer, _ngZone) {
|
|
227
233
|
this._renderer = _renderer;
|
|
228
234
|
this._elementRef = _elementRef;
|
|
229
235
|
this._domSanitizer = _domSanitizer;
|
|
236
|
+
this._ngZone = _ngZone;
|
|
230
237
|
this._simpleLineBreaks = false;
|
|
231
238
|
this._viewInit = false;
|
|
232
239
|
/**
|
|
@@ -276,15 +283,12 @@ class TdMarkdownComponent {
|
|
|
276
283
|
set anchor(anchor) {
|
|
277
284
|
this._anchor = anchor;
|
|
278
285
|
}
|
|
279
|
-
clickListener(event) {
|
|
280
|
-
const element = event.srcElement;
|
|
281
|
-
if (element.matches('a[href]') && isAnchorLink(element)) {
|
|
282
|
-
this.handleAnchorClicks(event);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
286
|
ngOnChanges(changes) {
|
|
286
287
|
// only anchor changed
|
|
287
|
-
if (changes
|
|
288
|
+
if (changes['anchor'] &&
|
|
289
|
+
!changes['content'] &&
|
|
290
|
+
!changes['simpleLineBreaks'] &&
|
|
291
|
+
!changes['hostedUrl']) {
|
|
288
292
|
scrollToAnchor(this._elementRef.nativeElement, this._anchor, true);
|
|
289
293
|
}
|
|
290
294
|
else {
|
|
@@ -296,6 +300,22 @@ class TdMarkdownComponent {
|
|
|
296
300
|
this._loadContent(this._elementRef.nativeElement.textContent);
|
|
297
301
|
}
|
|
298
302
|
this._viewInit = true;
|
|
303
|
+
// Caretaker note: the `scrollToAnchor` calls `element.scrollIntoView`, a native synchronous DOM
|
|
304
|
+
// API and it doesn't require Angular running `ApplicationRef.tick()` each time the markdown component is clicked.
|
|
305
|
+
// Host listener (added through `@HostListener`) cause Angular to add an event listener within the Angular zone.
|
|
306
|
+
// It also calls `markViewDirty()` before calling the actual listener (the decorated class method).
|
|
307
|
+
this._ngZone.runOutsideAngular(() => {
|
|
308
|
+
this._anchorListener = this._renderer.listen(this._elementRef.nativeElement, 'click', (event) => {
|
|
309
|
+
const element = event.srcElement;
|
|
310
|
+
if (element.matches('a[href]') &&
|
|
311
|
+
isAnchorLink(element)) {
|
|
312
|
+
this.handleAnchorClicks(event);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
ngOnDestroy() {
|
|
318
|
+
this._anchorListener?.();
|
|
299
319
|
}
|
|
300
320
|
refresh() {
|
|
301
321
|
if (this._content) {
|
|
@@ -319,7 +339,7 @@ class TdMarkdownComponent {
|
|
|
319
339
|
setTimeout(() => scrollToAnchor(this._elementRef.nativeElement, this._anchor, true), 250);
|
|
320
340
|
this.contentReady.emit();
|
|
321
341
|
}
|
|
322
|
-
|
|
342
|
+
handleAnchorClicks(event) {
|
|
323
343
|
event.preventDefault();
|
|
324
344
|
const url = new URL(event.target.href);
|
|
325
345
|
const hash = decodeURI(url.hash);
|
|
@@ -330,7 +350,7 @@ class TdMarkdownComponent {
|
|
|
330
350
|
// to parse the string into DOM element for now.
|
|
331
351
|
const div = this._renderer.createElement('div');
|
|
332
352
|
this._renderer.appendChild(this._elementRef.nativeElement, div);
|
|
333
|
-
const html = this._domSanitizer.sanitize(SecurityContext.HTML, markupStr);
|
|
353
|
+
const html = this._domSanitizer.sanitize(SecurityContext.HTML, markupStr) ?? '';
|
|
334
354
|
const htmlWithAbsoluteHrefs = normalizeHtmlHrefs(html, this._hostedUrl);
|
|
335
355
|
const htmlWithAbsoluteImgSrcs = normalizeImageSrcs(htmlWithAbsoluteHrefs, this._hostedUrl);
|
|
336
356
|
const htmlWithHeadingIds = addIdsToHeadings(htmlWithAbsoluteImgSrcs);
|
|
@@ -340,11 +360,16 @@ class TdMarkdownComponent {
|
|
|
340
360
|
}
|
|
341
361
|
_render(markdown) {
|
|
342
362
|
// Trim leading and trailing newlines
|
|
343
|
-
markdown = markdown
|
|
363
|
+
markdown = markdown
|
|
364
|
+
.replace(/^(\s|\t)*\n+/g, '')
|
|
365
|
+
.replace(/(\s|\t)*\n+(\s|\t)*$/g, '');
|
|
344
366
|
// Split markdown by line characters
|
|
345
367
|
let lines = markdown.split('\n');
|
|
346
368
|
// check how much indentation is used by the first actual markdown line
|
|
347
|
-
const
|
|
369
|
+
const firstLineWhitespaceMatch = lines[0].match(/^(\s|\t)*/);
|
|
370
|
+
const firstLineWhitespace = firstLineWhitespaceMatch
|
|
371
|
+
? firstLineWhitespaceMatch[0]
|
|
372
|
+
: '';
|
|
348
373
|
// Remove all indentation spaces so markdown can be parsed correctly
|
|
349
374
|
const startingWhitespaceRegex = new RegExp('^' + firstLineWhitespace);
|
|
350
375
|
lines = lines.map(function (line) {
|
|
@@ -362,39 +387,25 @@ class TdMarkdownComponent {
|
|
|
362
387
|
return converter.makeHtml(markdownToParse);
|
|
363
388
|
}
|
|
364
389
|
}
|
|
365
|
-
|
|
366
|
-
/** @nocollapse */ /** @nocollapse */ TdMarkdownComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TdMarkdownComponent, selectors: [["td-markdown"]], hostVars: 2, hostBindings: function TdMarkdownComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
i0.ɵɵclassMap(ctx.class);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
} }, 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}"] });
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
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"] }]
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
type: Input,
|
|
385
|
-
args: ['simpleLineBreaks']
|
|
386
|
-
}], hostedUrl: [{
|
|
387
|
-
type: Input,
|
|
388
|
-
args: ['hostedUrl']
|
|
389
|
-
}], anchor: [{
|
|
390
|
-
type: Input,
|
|
391
|
-
args: ['anchor']
|
|
392
|
-
}], contentReady: [{
|
|
393
|
-
type: Output
|
|
394
|
-
}], clickListener: [{
|
|
395
|
-
type: HostListener,
|
|
396
|
-
args: ['click', ['$event']]
|
|
397
|
-
}] }); })();
|
|
390
|
+
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 });
|
|
391
|
+
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"] });
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownComponent, decorators: [{
|
|
393
|
+
type: Component,
|
|
394
|
+
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"] }]
|
|
395
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.DomSanitizer }, { type: i0.NgZone }]; }, propDecorators: { class: [{
|
|
396
|
+
type: HostBinding,
|
|
397
|
+
args: ['class']
|
|
398
|
+
}], content: [{
|
|
399
|
+
type: Input
|
|
400
|
+
}], simpleLineBreaks: [{
|
|
401
|
+
type: Input
|
|
402
|
+
}], hostedUrl: [{
|
|
403
|
+
type: Input
|
|
404
|
+
}], anchor: [{
|
|
405
|
+
type: Input
|
|
406
|
+
}], contentReady: [{
|
|
407
|
+
type: Output
|
|
408
|
+
}] } });
|
|
398
409
|
|
|
399
410
|
class TdMarkdownLoaderService {
|
|
400
411
|
constructor(_http, _sanitizer) {
|
|
@@ -402,44 +413,48 @@ class TdMarkdownLoaderService {
|
|
|
402
413
|
this._sanitizer = _sanitizer;
|
|
403
414
|
}
|
|
404
415
|
async load(url, httpOptions = {}) {
|
|
405
|
-
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, url);
|
|
416
|
+
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, url) ?? '';
|
|
406
417
|
let urlToGet = sanitizedUrl;
|
|
407
418
|
if (isGithubHref(sanitizedUrl)) {
|
|
408
419
|
urlToGet = rawGithubHref(sanitizedUrl);
|
|
409
420
|
}
|
|
410
421
|
const response = await this._http
|
|
411
|
-
.get(urlToGet, {
|
|
422
|
+
.get(urlToGet, {
|
|
423
|
+
...httpOptions,
|
|
424
|
+
responseType: 'text',
|
|
425
|
+
observe: 'response',
|
|
426
|
+
})
|
|
412
427
|
.toPromise();
|
|
413
|
-
const contentType = response
|
|
414
|
-
if (contentType.includes('text/plain') ||
|
|
415
|
-
|
|
428
|
+
const contentType = response?.headers.get('Content-Type') ?? '';
|
|
429
|
+
if (contentType.includes('text/plain') ||
|
|
430
|
+
contentType.includes('text/markdown')) {
|
|
431
|
+
return response?.body ?? '';
|
|
416
432
|
}
|
|
417
433
|
else {
|
|
418
434
|
throw Error(`${contentType} is not a handled content type`);
|
|
419
435
|
}
|
|
420
436
|
}
|
|
421
437
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
(
|
|
425
|
-
|
|
426
|
-
|
|
438
|
+
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 });
|
|
439
|
+
TdMarkdownLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownLoaderService });
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TdMarkdownLoaderService, decorators: [{
|
|
441
|
+
type: Injectable
|
|
442
|
+
}], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: i1.DomSanitizer }]; } });
|
|
427
443
|
|
|
428
444
|
class CovalentMarkdownModule {
|
|
429
445
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
(
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentMarkdownModule, { declarations: [TdMarkdownComponent], imports: [CommonModule, HttpClientModule], exports: [TdMarkdownComponent] }); })();
|
|
446
|
+
CovalentMarkdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
447
|
+
CovalentMarkdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, declarations: [TdMarkdownComponent], imports: [CommonModule, HttpClientModule], exports: [TdMarkdownComponent] });
|
|
448
|
+
CovalentMarkdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, providers: [TdMarkdownLoaderService], imports: [[CommonModule, HttpClientModule]] });
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: CovalentMarkdownModule, decorators: [{
|
|
450
|
+
type: NgModule,
|
|
451
|
+
args: [{
|
|
452
|
+
imports: [CommonModule, HttpClientModule],
|
|
453
|
+
declarations: [TdMarkdownComponent],
|
|
454
|
+
exports: [TdMarkdownComponent],
|
|
455
|
+
providers: [TdMarkdownLoaderService],
|
|
456
|
+
}]
|
|
457
|
+
}] });
|
|
443
458
|
|
|
444
459
|
/**
|
|
445
460
|
* 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 HostListener,\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 {\n private _content: string;\n private _simpleLineBreaks: boolean = false;\n private _hostedUrl: string;\n private _anchor: string;\n private _viewInit: boolean = false;\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(private _renderer: Renderer2, private _elementRef: ElementRef, private _domSanitizer: DomSanitizer) {}\n\n @HostListener('click', ['$event'])\n clickListener(event: Event): void {\n const element: HTMLElement = <HTMLElement>event.srcElement;\n if (element.matches('a[href]') && isAnchorLink(<HTMLAnchorElement>element)) {\n this.handleAnchorClicks(event);\n }\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\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 async handleAnchorClicks(event: Event): Promise<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,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AAuB;cADnC,UAAU;;;MCSE,sBAAsB;;kIAAtB,sBAAsB;0HAAtB,sBAAsB;+HAFtB,CAAC,uBAAuB,CAAC,YAH3B,CAAC,YAAY,EAAE,gBAAgB,CAAC;uFAK9B,sBAAsB;cANlC,QAAQ;eAAC;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;gBACzC,YAAY,EAAE,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;gBAC9B,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACrC;;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\ndeclare const require: any;\nconst showdown: any = require('showdown/dist/showdown.js');\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,EAAE,CAAC,CAAC;KAC/B;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;SAEe,kBAAkB,CAAC,GAAkB;IACnD,IAAI,GAAG,EAAE;QACP,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M,QAAQ,GAAqC,MAAM,IAAI,CAAC,KAAK;aAChE,GAAG,CAAC,QAAQ,EAAE;YACb,GAAG,WAAW;YACd,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE,UAAU;SACpB,CAAC;aACD,SAAS,EAAE,CAAC;QACf,MAAM,WAAW,GAAW,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QACxE,IACE,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC;YAClC,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,EACrC;YACA,OAAO,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC;SAC7B;aAAM;YACL,MAAM,KAAK,CAAC,GAAG,WAAW,gCAAgC,CAAC,CAAC;SAC7D;KACF;;oHA3BU,uBAAuB;wHAAvB,uBAAuB;2FAAvB,uBAAuB;kBADnC,UAAU;;;MCSE,sBAAsB;;mHAAtB,sBAAsB;oHAAtB,sBAAsB,iBAJlB,mBAAmB,aADxB,YAAY,EAAE,gBAAgB,aAE9B,mBAAmB;oHAGlB,sBAAsB,aAFtB,CAAC,uBAAuB,CAAC,YAH3B,CAAC,YAAY,EAAE,gBAAgB,CAAC;2FAK9B,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;;;ACbD;;;;;;"}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function removeLeadingHash(str: string): string;
|
|
2
|
+
export declare function removeTrailingHash(str: string | null): string;
|
|
3
|
+
export declare function genHeadingId(str: string): string;
|
|
4
|
+
export declare function scrollToAnchor(scope: HTMLElement, anchor: string, tryParent: boolean): boolean;
|
|
5
|
+
export declare function isAnchorLink(anchor?: HTMLAnchorElement): boolean;
|
|
6
|
+
export declare function rawGithubHref(githubHref?: string): string;
|
|
7
|
+
export declare function isGithubHref(href?: string): boolean;
|
|
8
|
+
export declare function isRawGithubHref(href?: string): boolean;
|
|
9
|
+
export declare function renderVideoElements(html: string): string;
|