@covalent/markdown 4.0.0 → 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 +2 -1
- package/esm2020/covalent-markdown.mjs +5 -0
- 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 -0
- package/fesm2015/covalent-markdown.mjs +467 -0
- package/fesm2015/covalent-markdown.mjs.map +1 -0
- package/fesm2020/covalent-markdown.mjs +464 -0
- package/fesm2020/covalent-markdown.mjs.map +1 -0
- package/{markdown-loader → lib/markdown-loader}/markdown-loader.service.d.ts +3 -0
- package/lib/markdown-utils/markdown-utils.d.ts +9 -0
- package/{markdown.component.d.ts → lib/markdown.component.d.ts} +9 -4
- package/lib/markdown.module.d.ts +9 -0
- package/package.json +28 -33
- package/public_api.d.ts +4 -4
- package/_markdown-theme.scss +0 -57
- package/bundles/covalent-markdown.umd.js +0 -1055
- package/bundles/covalent-markdown.umd.js.map +0 -1
- package/bundles/covalent-markdown.umd.min.js +0 -16
- package/bundles/covalent-markdown.umd.min.js.map +0 -1
- package/covalent-markdown.metadata.json +0 -1
- package/esm2015/covalent-markdown.js +0 -10
- package/esm2015/index.js +0 -7
- package/esm2015/markdown-loader/markdown-loader.service.js +0 -69
- package/esm2015/markdown-utils/markdown-utils.js +0 -183
- package/esm2015/markdown.component.js +0 -439
- package/esm2015/markdown.module.js +0 -21
- package/esm2015/public_api.js +0 -10
- package/fesm2015/covalent-markdown.js +0 -724
- package/fesm2015/covalent-markdown.js.map +0 -1
- package/index.d.ts +0 -1
- package/markdown-utils/markdown-utils.d.ts +0 -9
- package/markdown.component.scss +0 -641
- package/markdown.module.d.ts +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"covalent-markdown.umd.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../src/platform/markdown/markdown-utils/markdown-utils.ts","../../../../src/platform/markdown/markdown.component.ts","../../../src/platform/markdown/markdown-loader/markdown-loader.service.ts","../../../../src/platform/markdown/markdown.module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","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","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"],"names":["EventEmitter","SecurityContext","Component","Renderer2","ElementRef","DomSanitizer","HostBinding","Input","Output","HostListener","Injectable","HttpClient","NgModule","CommonModule","HttpClientModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,IAAI,QAAQ,GAAG;QAClB,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAA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BAAA,EAAA,gBAAwB;;;;;;4BACxC,YAAY,GAAW,IAAI,CAAC,UAAU,CAAC,QAAQ,CAACR,oBAAe,CAAC,GAAG,EAAE,GAAG,CAAC;4BAC3E,QAAQ,GAAW,YAAY;4BACnC,IAAI,YAAY,CAAC,YAAY,CAAC,EAAE;gCAC9B,QAAQ,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;6BACxC;4BAEsC,qBAAM,IAAI,CAAC,KAAK;qCACpD,GAAG,CAAC,QAAQ,kCAAO,WAAW,KAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,IAAG;qCAC5E,SAAS,EAAE,EAAA;;4BAFR,QAAQ,GAAyB,SAEzB;4BACR,WAAW,GAAW,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;4BAChE,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;gCAC/E,sBAAO,QAAQ,CAAC,IAAI,EAAC;6BACtB;iCAAM;gCACL,MAAM,KAAK,CAAI,WAAW,mCAAgC,CAAC,CAAC;6BAC7D;;;;aACF;SAAA;;;;gBApBFS,eAAU;;;;gBAHFC,eAAU;gBADVN,4BAAY;;;;;;;QAMP,wCAAyB;;;;;QAAE,6CAAgC;;;;;;;;;QCOzE;;;;;gBANCO,aAAQ,SAAC;oBACR,OAAO,EAAE,CAACC,mBAAY,EAAEC,qBAAgB,CAAC;oBACzC,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/common/http"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@covalent/markdown",["exports","@angular/core","@angular/common","@angular/common/http","@angular/platform-browser"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).covalent=e.covalent||{},e.covalent.markdown={}),e.ng.core,e.ng.common,e.ng.common.http,e.ng.platformBrowser)}(this,(function(e,t,o,n,r){"use strict";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function d(e,t,o,n){return new(o||(o=Promise))((function(r,d){function a(e){try{s(n.next(e))}catch(e){d(e)}}function i(e){try{s(n.throw(e))}catch(e){d(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,i)}s((n=n.apply(e,t||[])).next())}))}function a(e,t){var o,n,r,d,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return d={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(d[Symbol.iterator]=function(){return this}),d;function i(d){return function(i){return function(d){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(r=2&d[0]?n.return:d[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,d[1])).done)return r;switch(n=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,n=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==d[0]&&2!==d[0])){a=0;continue}if(3===d[0]&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(6===d[0]&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(e){d=[6,e],n=0}finally{o=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,i])}}}Object.create;Object.create;function i(e){return e?e.replace(/^#+/,""):""}function s(e){return e?e.replace(/\#.*/,""):""}function h(e){return e?i(e.replace(/(_|-|\s)+/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"")).toLowerCase():""}function p(e,t,o){if(e&&t){var n=h(t),r=void 0,d=e.querySelector('[id="'+n+'"]');if(d)r=d;else if(o){var a=e.parentElement;a&&(r=a.querySelector('[id="'+n+'"]'))}if(r)return r.scrollIntoView({behavior:"auto"}),!0}return!1}function l(e){if(e){var t=e.getAttribute("href");if(t)return t.startsWith("#")}return!1}var m="raw.githubusercontent.com";function c(e){if(e)try{var t=new URL(e);if(t.hostname===m)return t.href;if(g(e))return t.hostname=m,t.pathname=t.pathname.split("/blob",2).join(""),t.href}catch(e){return""}return""}function g(e){try{return"github.com"===new URL(e).hostname}catch(e){return!1}}function A(e){try{return new URL(e).hostname===m}catch(e){return!1}}function w(e){function t(e,t,o){return o&&(t+="?"+o.replace(/&/gi,"&")),'<iframe allow="fullscreen" frameborder="0" src="https://www.youtube.com/embed/'+t+'"></iframe>'}return e.replace(/!\[(?:(?:https?:)?(?:\/\/)?)(?:(?:www)?.)?youtube.(?:.+?)\/(?:(?:watch\?v=)([\w-]{11})(&[\w%;-]+(?:=[\w%;-]+)?)*)]/gi,t).replace(/!\[(?:(?:https?:)?(?:\/\/)?)(?:(?:www)?.)?youtube.(?:.+?)\/(?:(?:embed\/)([\w-]{11})(\?[\w%;-]+(?:=[\w%;-]+)?(?:&[\w%;-]+(?:=[\w%;-]+)?)*)?)]/gi,t).replace(/!\[(?:(?:https?:)?(?:\/\/)?)?youtu.be\/([\w-]{11})\??([\w%;-]+(?:=[\w%;-]+)?(?:&[\w%;-]+(?:=[\w%;-]+)?)*)?]/gi,t).replace(/!\[(?:(?:https?:)?(?:\/\/)?)(?:(?:www)?.)?youtube.(?:.+?)\/(?:(?:playlist\?list=)([\w-]{34})(&[\w%;-]+(?:=[\w%;-]+)?)*)]/gi,(function(e,t,o){return o&&(t+=o.replace(/&/gi,"&")),'<iframe allow="fullscreen" frameborder="0" src="https://www.youtube.com/embed/videoseries?list='+t+'"></iframe>'}))}var k=require("showdown/dist/showdown.js");function u(e,t){if(e&&t){var o=new URL(e).pathname.split("/").slice(1,-1).join("/"),n=new URL(e);if(t.startsWith("/")){var r=o.split("/").slice(0,3).join("/");n.pathname=""+r+t}else n.pathname=o+"/"+t;return n.href}}var f=function(){function e(e,o,n){this._renderer=e,this._elementRef=o,this._domSanitizer=n,this._simpleLineBreaks=!1,this._viewInit=!1,this.class="td-markdown",this.contentReady=new t.EventEmitter}return Object.defineProperty(e.prototype,"content",{set:function(e){this._content=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"simpleLineBreaks",{set:function(e){this._simpleLineBreaks=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostedUrl",{set:function(e){this._hostedUrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{set:function(e){this._anchor=e},enumerable:!1,configurable:!0}),e.prototype.clickListener=function(e){var t=e.srcElement;t.matches("a[href]")&&l(t)&&this.handleAnchorClicks(e)},e.prototype.ngOnChanges=function(e){!e.anchor||e.content||e.simpleLineBreaks||e.hostedUrl?this.refresh():p(this._elementRef.nativeElement,this._anchor,!0)},e.prototype.ngAfterViewInit=function(){this._content||this._loadContent(this._elementRef.nativeElement.textContent),this._viewInit=!0},e.prototype.refresh=function(){this._content?this._loadContent(this._content):this._viewInit&&this._loadContent(this._elementRef.nativeElement.textContent)},e.prototype._loadContent=function(e){var t=this;e&&e.trim().length>0&&(this._renderer.setProperty(this._elementRef.nativeElement,"innerHTML",""),this._elementFromString(this._render(e))),setTimeout((function(){return p(t._elementRef.nativeElement,t._anchor,!0)}),250),this.contentReady.emit()},e.prototype.handleAnchorClicks=function(e){return d(this,void 0,void 0,(function(){var t,o;return a(this,(function(n){return e.preventDefault(),t=new URL(e.target.href),o=decodeURI(t.hash),p(this._elementRef.nativeElement,o,!0),[2]}))}))},e.prototype._elementFromString=function(e){var o=this._renderer.createElement("div");this._renderer.appendChild(this._elementRef.nativeElement,o);var n=w(function(e){if(e){var t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((function(e){var t=h(e.innerHTML);e.setAttribute("id",t)})),(new XMLSerializer).serializeToString(t)}return e}(function(e,t){if(t){var o=(new DOMParser).parseFromString(e,"text/html");return o.querySelectorAll("img[src]").forEach((function(e){var o=e.getAttribute("src");try{new URL(o),g(o)&&(e.src=c(o))}catch(n){e.src=u(g(t)?c(t):t,o)}if(A(e.src)){var n=new URL(e.src);n.pathname.endsWith(".svg")&&(n.searchParams.set("sanitize","true"),e.src=n.href)}})),(new XMLSerializer).serializeToString(o)}return e}(function(e,t){if(t){var o=(new DOMParser).parseFromString(e,"text/html");return o.querySelectorAll("a[href]").forEach((function(e){var o=new URL(e.href),n=o.hash;if(l(e))n&&(o.hash=h(n),e.href=o.hash);else if(o.host===window.location.host){if(o.pathname.endsWith(".md")){var r=s(e.getAttribute("href"));o.href=u(t,r),n&&(o.hash=h(n)),e.href=o.href}e.target="_blank"}else o.pathname.endsWith(".md")&&(n&&(o.hash=h(n)),e.href=o.href),e.target="_blank"})),(new XMLSerializer).serializeToString(o)}return e}(this._domSanitizer.sanitize(t.SecurityContext.HTML,e),this._hostedUrl),this._hostedUrl)));return this._renderer.setProperty(o,"innerHTML",n),o},e.prototype._render=function(e){var t=(e=e.replace(/^(\s|\t)*\n+/g,"").replace(/(\s|\t)*\n+(\s|\t)*$/g,"")).split("\n"),o=t[0].match(/^(\s|\t)*/)[0],n=new RegExp("^"+o),r=(t=t.map((function(e){return e.replace(n,"")}))).join("\n"),d=new k.Converter;return d.setOption("ghCodeBlocks",!0),d.setOption("tasklists",!0),d.setOption("tables",!0),d.setOption("literalMidWordUnderscores",!0),d.setOption("simpleLineBreaks",this._simpleLineBreaks),d.makeHtml(r)},e}();f.decorators=[{type:t.Component,args:[{selector:"td-markdown",template:"<ng-content></ng-content>\n",styles:['@font-face{:host.td-markdown::ng-deep{font-family:octicons-link;src:url("data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aF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5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==") format("woff")}}:host.td-markdown::ng-deep a{-webkit-text-decoration-skip:objects;background-color:rgba(0,0,0,0)}: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;overflow:visible}:host.td-markdown::ng-deep input{font:inherit;margin:0;overflow:visible}: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,:host.td-markdown::ng-deep button:-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-collapse:collapse;border-spacing:0}: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:active,:host.td-markdown::ng-deep a:hover{text-decoration:underline}:host.td-markdown::ng-deep hr{background:rgba(0,0,0,0);border-bottom-style:solid;border-bottom-width:1px;height:0;margin:15px 0;overflow:hidden}:host.td-markdown::ng-deep hr:before{content:"";display:table}:host.td-markdown::ng-deep hr:after{clear:both;content:"";display:table}: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{line-height:1.5;margin-bottom:0;margin-top:0}: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-bottom:10px;margin-top:0}:host.td-markdown::ng-deep blockquote{margin:0}:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep ul{margin-bottom:0;margin-top:0;padding-left: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 ol ol ol,:host.td-markdown::ng-deep ol ul ol,:host.td-markdown::ng-deep ul ol ol,:host.td-markdown::ng-deep ul ul 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{font:12px Consolas,Liberation Mono,Menlo,Courier,monospace;margin-bottom:0;margin-top:0}: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{font-weight:700;line-height:1.4;margin-bottom:16px;margin-top:1em}: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{border-bottom-style:solid;border-bottom-width:1px;font-size:2.25em;line-height:1.2;padding-bottom:.3em}:host.td-markdown::ng-deep h1 .anchor{line-height:1}:host.td-markdown::ng-deep h2{border-bottom-style:solid;border-bottom-width:1px;font-size:1.75em;line-height:1.225;padding-bottom:.3em}: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 blockquote,:host.td-markdown::ng-deep dl,:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep p,:host.td-markdown::ng-deep pre,:host.td-markdown::ng-deep table,:host.td-markdown::ng-deep ul{margin-bottom:16px;margin-top:0}:host.td-markdown::ng-deep hr{margin:16px 0}:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep ul{padding-left:2em}:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ol ul,:host.td-markdown::ng-deep ul ol,:host.td-markdown::ng-deep ul ul{margin-bottom:0;margin-top: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{font-size:1em;font-style:italic;font-weight:700;margin-top:16px;padding:0}:host.td-markdown::ng-deep dl dd{margin-bottom:16px;padding:0 16px}:host.td-markdown::ng-deep blockquote{border-left-style:solid;border-left-width:4px;padding:0 15px}: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;overflow:auto;width:100%;word-break:normal;word-break:keep-all}:host.td-markdown::ng-deep table th{font-weight:700}:host.td-markdown::ng-deep table td,:host.td-markdown::ng-deep table th{border-style:solid;border-width:1px;padding:6px 13px}:host.td-markdown::ng-deep table tr{border-top-style:solid;border-top-width:1px}:host.td-markdown::ng-deep img{box-sizing:content-box;max-width:100%}:host.td-markdown::ng-deep code{border-radius:3px;font-size:85%;margin:0;padding:.2em 0}:host.td-markdown::ng-deep code:after,:host.td-markdown::ng-deep code:before{letter-spacing:-.2em}:host.td-markdown::ng-deep pre>code{background:rgba(0,0,0,0);border:0;font-size:100%;margin:0;padding:0;white-space:pre;word-break:normal}:host.td-markdown::ng-deep .highlight{margin-bottom:16px}:host.td-markdown::ng-deep .highlight pre,:host.td-markdown::ng-deep pre{border-radius:3px;font-size:85%;line-height:1.45;overflow:auto;padding:16px}: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{background-color:rgba(0,0,0,0);border:0;display:inline;line-height:inherit;margin:0;max-width:none;overflow:initial;padding:0;word-wrap:normal}:host.td-markdown::ng-deep pre code:after,:host.td-markdown::ng-deep pre code:before{content:normal}:host.td-markdown::ng-deep kbd{border-style:solid;border-width:1px;font-size:11px}: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{background-color:#fcfcfc;border:1px solid;border-color:#ccc #ccc #bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb;display:inline-block;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;padding:3px 5px;vertical-align:middle}:host.td-markdown::ng-deep .full-commit .btn-outline:not(:disabled):hover{border:1px solid #4078c0;color:#4078c0}:host.td-markdown::ng-deep :checked+.radio-label{border-color:#4078c0;position:relative;z-index:1}:host.td-markdown::ng-deep .octicon{display:inline-block;fill:currentColor;vertical-align:text-top}: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}']}]}],f.ctorParameters=function(){return[{type:t.Renderer2},{type:t.ElementRef},{type:r.DomSanitizer}]},f.propDecorators={class:[{type:t.HostBinding,args:["class"]}],content:[{type:t.Input,args:["content"]}],simpleLineBreaks:[{type:t.Input,args:["simpleLineBreaks"]}],hostedUrl:[{type:t.Input,args:["hostedUrl"]}],anchor:[{type:t.Input,args:["anchor"]}],contentReady:[{type:t.Output}],clickListener:[{type:t.HostListener,args:["click",["$event"]]}]};var b=function(){function e(e,t){this._http=e,this._sanitizer=t}return e.prototype.load=function(e,o){return void 0===o&&(o={}),d(this,void 0,void 0,(function(){var n,r,d,i;return a(this,(function(a){switch(a.label){case 0:return n=this._sanitizer.sanitize(t.SecurityContext.URL,e),r=n,g(n)&&(r=c(n)),[4,this._http.get(r,Object.assign(Object.assign({},o),{responseType:"text",observe:"response"})).toPromise()];case 1:if(d=a.sent(),(i=d.headers.get("Content-Type")).includes("text/plain")||i.includes("text/markdown"))return[2,d.body];throw Error(i+" is not a handled content type")}}))}))},e}();b.decorators=[{type:t.Injectable}],b.ctorParameters=function(){return[{type:n.HttpClient},{type:r.DomSanitizer}]};var y=function(){};y.decorators=[{type:t.NgModule,args:[{imports:[o.CommonModule,n.HttpClientModule],declarations:[f],exports:[f],providers:[b]}]}],e.CovalentMarkdownModule=y,e.TdMarkdownComponent=f,e.TdMarkdownLoaderService=b,e.genHeadingId=h,e.isAnchorLink=l,e.isGithubHref=g,e.isRawGithubHref=A,e.rawGithubHref=c,e.removeLeadingHash=i,e.removeTrailingHash=s,e.renderVideoElements=w,e.scrollToAnchor=p,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
|
-
//# sourceMappingURL=covalent-markdown.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../src/platform/markdown/markdown-utils/markdown-utils.ts","../../../../src/platform/markdown/markdown.component.ts","../../../src/platform/markdown/markdown-loader/markdown-loader.service.ts","../../../../src/platform/markdown/markdown.module.ts"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","Object","create","removeLeadingHash","str","replace","removeTrailingHash","genHeadingId","toLowerCase","scrollToAnchor","scope","anchor","tryParent","normalizedAnchor","headingToJumpTo","headingWithinComponent","querySelector","parent","parentElement","scrollIntoView","behavior","isAnchorLink","href","getAttribute","startsWith","RAW_GITHUB_HOSTNAME","rawGithubHref","githubHref","url","URL","hostname","isGithubHref","pathname","split","join","_a","isRawGithubHref","renderVideoElements","html","convert","match","id","flags","showdown","require","generateAbsoluteHref","currentHref","relativeHref","path","slice","correctUrl","orgAndRepo","TdMarkdownComponent","_renderer","_elementRef","_domSanitizer","_simpleLineBreaks","_viewInit","class","contentReady","EventEmitter","defineProperty","prototype","content","_content","simpleLineBreaks","hostedUrl","_hostedUrl","_anchor","clickListener","event","element","matches","handleAnchorClicks","ngOnChanges","changes","refresh","nativeElement","ngAfterViewInit","_loadContent","textContent","markdown","_this","trim","setProperty","_elementFromString","_render","setTimeout","emit","preventDefault","hash","decodeURI","markupStr","div","createElement","appendChild","htmlWithVideos","document","DOMParser","parseFromString","querySelectorAll","forEach","heading","innerHTML","setAttribute","XMLSerializer","serializeToString","addIdsToHeadings","image","src","endsWith","searchParams","set","normalizeImageSrcs","link","originalHash","host","window","location","hrefWithoutHash","target","normalizeHtmlHrefs","sanitize","SecurityContext","HTML","lines","firstLineWhitespace","startingWhitespaceRegex","RegExp","markdownToParse","map","line","converter","Converter","setOption","makeHtml","Component","args","selector","template","Renderer2","ElementRef","DomSanitizer","HostBinding","Input","Output","HostListener","TdMarkdownLoaderService","_http","_sanitizer","load","httpOptions","sanitizedUrl","urlToGet","get","assign","responseType","observe","toPromise","response","contentType","headers","includes","Error","Injectable","HttpClient","NgModule","imports","CommonModule","HttpClientModule","declarations","exports","providers"],"mappings":";;;;;;;;;;;;;;6FAmEgBA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,I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AAAwF,KAAA,SAAK1H,EAAa2H,eAAA,IAAAA,IAAAA,EAAA,mGAOiB,OANjCC,EAAuBhK,KAAK6J,WAAW3B,SAASC,EAAAA,gBAAgB9F,IAAKD,GACvE6H,EAAmBD,EACnBzH,EAAayH,KACfC,EAAW/H,EAAc8H,IAGY,CAAA,EAAMhK,KAAK4J,MAC/CM,IAAID,EAAQxJ,OAAA0J,OAAA1J,OAAA0J,OAAA,GAAOJ,GAAW,CAAEK,aAAc,OAAQC,QAAS,cAC/DC,oBAEH,GAJMC,EAAiC5H,EAAAnD,QAGjCgL,EAAsBD,EAASE,QAAQP,IAAI,iBACjCQ,SAAS,eAAiBF,EAAYE,SAAS,iBAC7D,MAAA,CAAA,EAAOH,EAAStL,MAEhB,MAAM0L,MAASH,EAAW,mEAlB/BI,EAAAA,sDAHQC,EAAAA,kBADAvB,EAAAA,sBCaT,iCANCwB,EAAAA,SAAQ7B,KAAA,CAAC,CACR8B,QAAS,CAACC,EAAAA,aAAcC,EAAAA,kBACxBC,aAAc,CAACtH,GACfuH,QAAS,CAACvH,GACVwH,UAAW,CAACzB","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","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","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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"CovalentMarkdownModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":8,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":12},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClientModule","line":9,"character":26}],"declarations":[{"__symbolic":"reference","name":"TdMarkdownComponent"}],"exports":[{"__symbolic":"reference","name":"TdMarkdownComponent"}],"providers":[{"__symbolic":"reference","name":"TdMarkdownLoaderService"}]}]}],"members":{}},"TdMarkdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":135,"character":1},"arguments":[{"selector":"td-markdown","template":"<ng-content></ng-content>\n","styles":["@font-face{:host.td-markdown::ng-deep{font-family:octicons-link;src:url(\"data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAAC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kAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==\") format(\"woff\")}}:host.td-markdown::ng-deep a{-webkit-text-decoration-skip:objects;background-color:rgba(0,0,0,0)}: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;overflow:visible}:host.td-markdown::ng-deep input{font:inherit;margin:0;overflow:visible}: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,:host.td-markdown::ng-deep button:-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-collapse:collapse;border-spacing:0}: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:active,:host.td-markdown::ng-deep a:hover{text-decoration:underline}:host.td-markdown::ng-deep hr{background:rgba(0,0,0,0);border-bottom-style:solid;border-bottom-width:1px;height:0;margin:15px 0;overflow:hidden}:host.td-markdown::ng-deep hr:before{content:\"\";display:table}:host.td-markdown::ng-deep hr:after{clear:both;content:\"\";display:table}: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{line-height:1.5;margin-bottom:0;margin-top:0}: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-bottom:10px;margin-top:0}:host.td-markdown::ng-deep blockquote{margin:0}:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep ul{margin-bottom:0;margin-top:0;padding-left: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 ol ol ol,:host.td-markdown::ng-deep ol ul ol,:host.td-markdown::ng-deep ul ol ol,:host.td-markdown::ng-deep ul ul 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{font:12px Consolas,Liberation Mono,Menlo,Courier,monospace;margin-bottom:0;margin-top:0}: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{font-weight:700;line-height:1.4;margin-bottom:16px;margin-top:1em}: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{border-bottom-style:solid;border-bottom-width:1px;font-size:2.25em;line-height:1.2;padding-bottom:.3em}:host.td-markdown::ng-deep h1 .anchor{line-height:1}:host.td-markdown::ng-deep h2{border-bottom-style:solid;border-bottom-width:1px;font-size:1.75em;line-height:1.225;padding-bottom:.3em}: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 blockquote,:host.td-markdown::ng-deep dl,:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep p,:host.td-markdown::ng-deep pre,:host.td-markdown::ng-deep table,:host.td-markdown::ng-deep ul{margin-bottom:16px;margin-top:0}:host.td-markdown::ng-deep hr{margin:16px 0}:host.td-markdown::ng-deep ol,:host.td-markdown::ng-deep ul{padding-left:2em}:host.td-markdown::ng-deep ol ol,:host.td-markdown::ng-deep ol ul,:host.td-markdown::ng-deep ul ol,:host.td-markdown::ng-deep ul ul{margin-bottom:0;margin-top: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{font-size:1em;font-style:italic;font-weight:700;margin-top:16px;padding:0}:host.td-markdown::ng-deep dl dd{margin-bottom:16px;padding:0 16px}:host.td-markdown::ng-deep blockquote{border-left-style:solid;border-left-width:4px;padding:0 15px}: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;overflow:auto;width:100%;word-break:normal;word-break:keep-all}:host.td-markdown::ng-deep table th{font-weight:700}:host.td-markdown::ng-deep table td,:host.td-markdown::ng-deep table th{border-style:solid;border-width:1px;padding:6px 13px}:host.td-markdown::ng-deep table tr{border-top-style:solid;border-top-width:1px}:host.td-markdown::ng-deep img{box-sizing:content-box;max-width:100%}:host.td-markdown::ng-deep code{border-radius:3px;font-size:85%;margin:0;padding:.2em 0}:host.td-markdown::ng-deep code:after,:host.td-markdown::ng-deep code:before{letter-spacing:-.2em}:host.td-markdown::ng-deep pre>code{background:rgba(0,0,0,0);border:0;font-size:100%;margin:0;padding:0;white-space:pre;word-break:normal}:host.td-markdown::ng-deep .highlight{margin-bottom:16px}:host.td-markdown::ng-deep .highlight pre,:host.td-markdown::ng-deep pre{border-radius:3px;font-size:85%;line-height:1.45;overflow:auto;padding:16px}: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{background-color:rgba(0,0,0,0);border:0;display:inline;line-height:inherit;margin:0;max-width:none;overflow:initial;padding:0;word-wrap:normal}:host.td-markdown::ng-deep pre code:after,:host.td-markdown::ng-deep pre code:before{content:normal}:host.td-markdown::ng-deep kbd{border-style:solid;border-width:1px;font-size:11px}: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{background-color:#fcfcfc;border:1px solid;border-color:#ccc #ccc #bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb;display:inline-block;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;padding:3px 5px;vertical-align:middle}:host.td-markdown::ng-deep .full-commit .btn-outline:not(:disabled):hover{border:1px solid #4078c0;color:#4078c0}:host.td-markdown::ng-deep :checked+.radio-label{border-color:#4078c0;position:relative;z-index:1}:host.td-markdown::ng-deep .octicon{display:inline-block;fill:currentColor;vertical-align:text-top}: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}"]}]}],"members":{"class":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":149,"character":3},"arguments":["class"]}]}],"content":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":158,"character":3},"arguments":["content"]}]}],"simpleLineBreaks":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":169,"character":3},"arguments":["simpleLineBreaks"]}]}],"hostedUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":180,"character":3},"arguments":["hostedUrl"]}]}],"anchor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":191,"character":3},"arguments":["anchor"]}]}],"contentReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":200,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":202,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":202,"character":65},{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":202,"character":100}]}],"clickListener":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":204,"character":3},"arguments":["click",["$event"]]}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"refresh":[{"__symbolic":"method"}],"_loadContent":[{"__symbolic":"method"}],"handleAnchorClicks":[{"__symbolic":"method"}],"_elementFromString":[{"__symbolic":"method"}],"_render":[{"__symbolic":"method"}]}},"removeLeadingHash":{"__symbolic":"function"},"removeTrailingHash":{"__symbolic":"function"},"genHeadingId":{"__symbolic":"function"},"scrollToAnchor":{"__symbolic":"function"},"isAnchorLink":{"__symbolic":"function"},"rawGithubHref":{"__symbolic":"function"},"isGithubHref":{"__symbolic":"function"},"isRawGithubHref":{"__symbolic":"function"},"renderVideoElements":{"__symbolic":"function"},"TdMarkdownLoaderService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":5,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":7,"character":29},{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":7,"character":61}]}],"load":[{"__symbolic":"method"}]}}},"origins":{"CovalentMarkdownModule":"./markdown.module","TdMarkdownComponent":"./markdown.component","removeLeadingHash":"./markdown-utils/markdown-utils","removeTrailingHash":"./markdown-utils/markdown-utils","genHeadingId":"./markdown-utils/markdown-utils","scrollToAnchor":"./markdown-utils/markdown-utils","isAnchorLink":"./markdown-utils/markdown-utils","rawGithubHref":"./markdown-utils/markdown-utils","isGithubHref":"./markdown-utils/markdown-utils","isRawGithubHref":"./markdown-utils/markdown-utils","renderVideoElements":"./markdown-utils/markdown-utils","TdMarkdownLoaderService":"./markdown-loader/markdown-loader.service"},"importAs":"@covalent/markdown"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: covalent-markdown.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Generated bundle index. Do not edit.
|
|
8
|
-
*/
|
|
9
|
-
export { CovalentMarkdownModule, TdMarkdownComponent, removeLeadingHash, removeTrailingHash, genHeadingId, scrollToAnchor, isAnchorLink, rawGithubHref, isGithubHref, isRawGithubHref, renderVideoElements, TdMarkdownLoaderService } from './index';
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY292YWxlbnQtbWFya2Rvd24uanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL21hcmtkb3duLyIsInNvdXJjZXMiOlsiY292YWxlbnQtbWFya2Rvd24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFJQSwyT0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
package/esm2015/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: index.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
export { CovalentMarkdownModule, TdMarkdownComponent, removeLeadingHash, removeTrailingHash, genHeadingId, scrollToAnchor, isAnchorLink, rawGithubHref, isGithubHref, isRawGithubHref, renderVideoElements, TdMarkdownLoaderService } from './public_api';
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL21hcmtkb3duLyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSwyT0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: markdown-loader/markdown-loader.service.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
import { __awaiter } from "tslib";
|
|
7
|
-
import { Injectable, SecurityContext } from '@angular/core';
|
|
8
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
|
-
import { HttpClient } from '@angular/common/http';
|
|
10
|
-
import { isGithubHref, rawGithubHref } from '../markdown-utils/markdown-utils';
|
|
11
|
-
export class TdMarkdownLoaderService {
|
|
12
|
-
/**
|
|
13
|
-
* @param {?} _http
|
|
14
|
-
* @param {?} _sanitizer
|
|
15
|
-
*/
|
|
16
|
-
constructor(_http, _sanitizer) {
|
|
17
|
-
this._http = _http;
|
|
18
|
-
this._sanitizer = _sanitizer;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param {?} url
|
|
22
|
-
* @param {?=} httpOptions
|
|
23
|
-
* @return {?}
|
|
24
|
-
*/
|
|
25
|
-
load(url, httpOptions = {}) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
/** @type {?} */
|
|
28
|
-
const sanitizedUrl = this._sanitizer.sanitize(SecurityContext.URL, url);
|
|
29
|
-
/** @type {?} */
|
|
30
|
-
let urlToGet = sanitizedUrl;
|
|
31
|
-
if (isGithubHref(sanitizedUrl)) {
|
|
32
|
-
urlToGet = rawGithubHref(sanitizedUrl);
|
|
33
|
-
}
|
|
34
|
-
/** @type {?} */
|
|
35
|
-
const response = yield this._http
|
|
36
|
-
.get(urlToGet, Object.assign(Object.assign({}, httpOptions), { responseType: 'text', observe: 'response' }))
|
|
37
|
-
.toPromise();
|
|
38
|
-
/** @type {?} */
|
|
39
|
-
const contentType = response.headers.get('Content-Type');
|
|
40
|
-
if (contentType.includes('text/plain') || contentType.includes('text/markdown')) {
|
|
41
|
-
return response.body;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw Error(`${contentType} is not a handled content type`);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
TdMarkdownLoaderService.decorators = [
|
|
50
|
-
{ type: Injectable }
|
|
51
|
-
];
|
|
52
|
-
/** @nocollapse */
|
|
53
|
-
TdMarkdownLoaderService.ctorParameters = () => [
|
|
54
|
-
{ type: HttpClient },
|
|
55
|
-
{ type: DomSanitizer }
|
|
56
|
-
];
|
|
57
|
-
if (false) {
|
|
58
|
-
/**
|
|
59
|
-
* @type {?}
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
TdMarkdownLoaderService.prototype._http;
|
|
63
|
-
/**
|
|
64
|
-
* @type {?}
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
TdMarkdownLoaderService.prototype._sanitizer;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2Rvd24tbG9hZGVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL21hcmtkb3duLyIsInNvdXJjZXMiOlsibWFya2Rvd24tbG9hZGVyL21hcmtkb3duLWxvYWRlci5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLE9BQU8sRU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