@bartificer/linkify 2.3.5 → 2.4.1
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 +135 -35
- package/dist/index.js +1 -1
- package/docs/LinkData.class.mjs.html +119 -56
- package/docs/LinkTemplate.class.mjs.html +120 -36
- package/docs/Linkifier.class.mjs.html +141 -66
- package/docs/PageData.class.mjs.html +145 -72
- package/docs/defaults.mjs.html +136 -12
- package/docs/docdash-overrides.css +11 -0
- package/docs/externals.jsdoc.html +95 -4
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/global.html +1276 -0
- package/docs/index.html +1018 -26
- package/docs/index.js.html +143 -17
- package/docs/mermaid-init.js +21 -0
- package/docs/module-cheerio.html +193 -3
- package/docs/module-defaults.html +680 -3
- package/docs/module-link-data.LinkData.html +813 -0
- package/docs/module-link-data.html +226 -0
- package/docs/module-link-template.LinkTemplate.html +792 -0
- package/docs/module-link-template.html +226 -0
- package/docs/module-linkifier.Linkifier.html +2050 -0
- package/docs/module-linkifier.html +236 -0
- package/docs/module-linkify.html +810 -3
- package/docs/module-mustache.html +193 -3
- package/docs/module-node-fetch.html +193 -3
- package/docs/module-page-data.PageData.html +1810 -0
- package/docs/module-page-data.html +226 -0
- package/docs/module-title-case.html +193 -3
- package/docs/module-urijs.html +193 -3
- package/docs/module-url-slug.html +193 -3
- package/docs/module-utilities.html +1518 -3
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/{third-party → prettify}/Apache-License-2.0.txt +202 -202
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -265
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/docs/typedefs.jsdoc.html +145 -0
- package/docs/utilities.mjs.html +154 -22
- package/examples/clipboardURLToMarkdown.mjs +80 -1
- package/package.json +5 -3
- package/src/LinkData.class.mjs +24 -52
- package/src/LinkTemplate.class.mjs +25 -32
- package/src/Linkifier.class.mjs +46 -62
- package/src/PageData.class.mjs +50 -68
- package/src/defaults.mjs +42 -8
- package/src/index.js +48 -13
- package/src/typedefs.jsdoc +52 -0
- package/src/utilities.mjs +59 -18
- package/docs/data/search.json +0 -1
- package/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/module-LinkData.LinkData.html +0 -13
- package/docs/module-LinkData.html +0 -3
- package/docs/module-LinkTemplate.LinkTemplate.html +0 -3
- package/docs/module-LinkTemplate.html +0 -3
- package/docs/module-Linkifier.Linkifier.html +0 -3
- package/docs/module-Linkifier.html +0 -3
- package/docs/module-PageData.PageData.html +0 -15
- package/docs/module-PageData.html +0 -3
- package/docs/scripts/core.js +0 -726
- package/docs/scripts/core.min.js +0 -23
- package/docs/scripts/resize.js +0 -90
- package/docs/scripts/search.min.js +0 -6
- package/docs/scripts/third-party/fuse.js +0 -9
- package/docs/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/scripts/third-party/hljs-original.js +0 -5171
- package/docs/scripts/third-party/hljs.js +0 -1
- package/docs/scripts/third-party/popper.js +0 -5
- package/docs/scripts/third-party/tippy.js +0 -1
- package/docs/scripts/third-party/tocbot.js +0 -672
- package/docs/scripts/third-party/tocbot.min.js +0 -1
- package/docs/styles/clean-jsdoc-theme-base.css +0 -1159
- package/docs/styles/clean-jsdoc-theme-dark.css +0 -412
- package/docs/styles/clean-jsdoc-theme-light.css +0 -482
- package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -30
- package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
- package/docs/styles/clean-jsdoc-theme.min.css +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.pln {
|
|
2
|
+
color: #ddd;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* string content */
|
|
6
|
+
.str {
|
|
7
|
+
color: #61ce3c;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* a keyword */
|
|
11
|
+
.kwd {
|
|
12
|
+
color: #fbde2d;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* a comment */
|
|
16
|
+
.com {
|
|
17
|
+
color: #aeaeae;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* a type name */
|
|
21
|
+
.typ {
|
|
22
|
+
color: #8da6ce;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* a literal value */
|
|
26
|
+
.lit {
|
|
27
|
+
color: #fbde2d;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* punctuation */
|
|
31
|
+
.pun {
|
|
32
|
+
color: #ddd;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* lisp open bracket */
|
|
36
|
+
.opn {
|
|
37
|
+
color: #000000;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* lisp close bracket */
|
|
41
|
+
.clo {
|
|
42
|
+
color: #000000;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* a markup tag name */
|
|
46
|
+
.tag {
|
|
47
|
+
color: #8da6ce;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* a markup attribute name */
|
|
51
|
+
.atn {
|
|
52
|
+
color: #fbde2d;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* a markup attribute value */
|
|
56
|
+
.atv {
|
|
57
|
+
color: #ddd;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* a declaration */
|
|
61
|
+
.dec {
|
|
62
|
+
color: #EF5050;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* a variable name */
|
|
66
|
+
.var {
|
|
67
|
+
color: #c82829;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* a function name */
|
|
71
|
+
.fun {
|
|
72
|
+
color: #4271ae;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
76
|
+
ol.linenums {
|
|
77
|
+
margin-top: 0;
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
padding-bottom: 2px;
|
|
80
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>typedefs.jsdoc - @bartificer/linkify Documentation</title>
|
|
7
|
+
|
|
8
|
+
<meta name="description" content="Documentation for the @bartificer/linkify package" />
|
|
9
|
+
|
|
10
|
+
<meta name="keywords" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
|
|
11
|
+
<meta name="keyword" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<meta property="og:title" content="@bartificer/linkify"/>
|
|
16
|
+
<meta property="og:type" content="website"/>
|
|
17
|
+
<meta property="og:image" content=""/>
|
|
18
|
+
<meta property="og:site_name" content="@bartificer/linkify Documentation"/>
|
|
19
|
+
<meta property="og:url" content="https://bartificer.github.io/linkify/"/>
|
|
20
|
+
|
|
21
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
22
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
23
|
+
<!--[if lt IE 9]>
|
|
24
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
25
|
+
<![endif]-->
|
|
26
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
27
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
28
|
+
<script src="scripts/nav.js" defer></script>
|
|
29
|
+
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
|
|
34
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
35
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
36
|
+
<div class="navicon"></div>
|
|
37
|
+
</label>
|
|
38
|
+
|
|
39
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
40
|
+
|
|
41
|
+
<nav class="wrap">
|
|
42
|
+
|
|
43
|
+
<input type="text" id="nav-search" placeholder="Search" />
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/bartificer/linkify" target="_blank" >On GitHub</a></h2><h2><a href="https://bartificer.net/" target="_blank" >Bartificer Creations</a></h2><h3>Modules</h3><ul><li><a href="module-defaults.html">defaults</a><ul class='members'><li data-type='member'><a href="module-defaults.html#.linkTemplates">linkTemplates</a></li><li data-type='member'><a href="module-defaults.html#.smallWords">smallWords</a></li><li data-type='member'><a href="module-defaults.html#.speciallyCapitalisedWords">speciallyCapitalisedWords</a></li></ul><ul class='methods'><li data-type='method'><a href="module-defaults.html#.dataTransformer">dataTransformer</a></li></ul></li><li><a href="module-link-data.html">link-data</a></li><li><a href="module-link-template.html">link-template</a></li><li><a href="module-linkifier.html">linkifier</a></li><li><a href="module-linkify.html">linkify</a><ul class='members'><li data-type='member'><a href="module-linkify.html#.LinkData">LinkData</a></li><li data-type='member'><a href="module-linkify.html#.LinkTemplate">LinkTemplate</a></li><li data-type='member'><a href="module-linkify.html#.Linkifier">Linkifier</a></li><li data-type='member'><a href="module-linkify.html#.PageData">PageData</a></li><li data-type='member'><a href="module-linkify.html#.VERSION">VERSION</a></li><li data-type='member'><a href="module-linkify.html#.default">default</a></li><li data-type='member'><a href="module-linkify.html#.linkify">linkify</a></li></ul></li><li><a href="module-page-data.html">page-data</a></li><li><a href="module-utilities.html">utilities</a><ul class='methods'><li data-type='method'><a href="module-utilities.html#.batchFixCustomWordCases">batchFixCustomWordCases</a></li><li data-type='method'><a href="module-utilities.html#.escapeRegex">escapeRegex</a></li><li data-type='method'><a href="module-utilities.html#.extractSlug">extractSlug</a></li><li data-type='method'><a href="module-utilities.html#.regulariseWhitespace">regulariseWhitespace</a></li><li data-type='method'><a href="module-utilities.html#.stripQueryString">stripQueryString</a></li><li data-type='method'><a href="module-utilities.html#.stripUTMParameters">stripUTMParameters</a></li><li data-type='method'><a href="module-utilities.html#.toTitleCase">toTitleCase</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="module-link-data.LinkData.html">LinkData</a><ul class='methods'><li data-type='method'><a href="module-link-data.LinkData.html#asPlainObject">asPlainObject</a></li></ul></li><li><a href="module-link-template.LinkTemplate.html">LinkTemplate</a><ul class='methods'><li data-type='method'><a href="module-link-template.LinkTemplate.html#addFilter">addFilter</a></li><li data-type='method'><a href="module-link-template.LinkTemplate.html#filtersFor">filtersFor</a></li></ul></li><li><a href="module-linkifier.Linkifier.html">Linkifier</a><ul class='methods'><li data-type='method'><a href="module-linkifier.Linkifier.html#fetchPageData">fetchPageData</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#generateLink">generateLink</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplate">getTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplateNameForDomain">getTemplateNameForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTransformerForDomain">getTransformerForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerDefaultTemplateMapping">registerDefaultTemplateMapping</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTemplate">registerTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTransformer">registerTransformer</a></li></ul></li><li><a href="module-page-data.PageData.html">PageData</a><ul class='methods'><li data-type='method'><a href="module-page-data.PageData.html#addSecondaryHeading">addSecondaryHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#addTopLevelHeading">addTopLevelHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#asPlainObject">asPlainObject</a></li><li data-type='method'><a href="module-page-data.PageData.html#h1">h1</a></li><li data-type='method'><a href="module-page-data.PageData.html#h2">h2</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#dataTransformer">dataTransformer</a></li><li><a href="global.html#plainLinkInformationObject">plainLinkInformationObject</a></li><li><a href="global.html#plainPageInformationObject">plainPageInformationObject</a></li><li><a href="global.html#templateFieldFilterFunction">templateFieldFilterFunction</a></li><li><a href="global.html#templateFieldFilterTuple">templateFieldFilterTuple</a></li></ul><h3>Externals</h3><ul><li><a href="module-cheerio.html">cheerio</a></li><li><a href="module-mustache.html">mustache</a></li><li><a href="module-node-fetch.html">node-fetch</a></li><li><a href="module-title-case.html">title-case</a></li><li><a href="module-urijs.html">urijs</a></li><li><a href="module-url-slug.html">url-slug</a></li></ul>
|
|
47
|
+
|
|
48
|
+
</nav>
|
|
49
|
+
|
|
50
|
+
<div id="main">
|
|
51
|
+
|
|
52
|
+
<h1 class="page-title">typedefs.jsdoc</h1>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<section>
|
|
61
|
+
<article>
|
|
62
|
+
<pre class="prettyprint source linenums"><code>/**
|
|
63
|
+
* Functions for converting information extracted from a web page into the information used to render links.
|
|
64
|
+
* @callback dataTransformer
|
|
65
|
+
* @param {module:page-data.PageData} pData - The web page data to be transrormed to link data.
|
|
66
|
+
* @returns {module:link-data.LinkData} The link information derived from the page data.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Functions for filtering template field values before their use to render links. Arbitrarily many of these functions can be added to a template in order to filter individual fields, or all fields.
|
|
71
|
+
* @callback templateFieldFilterFunction
|
|
72
|
+
* @param {string} originalString - the original value for the field to be filtered.
|
|
73
|
+
* @returns {string} the filtered version of the original string.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A tupple (array of length exactly two) for assigning a field filter to a template.
|
|
78
|
+
* @typedef {Array} templateFieldFilterTuple
|
|
79
|
+
* @property {"all"|"url"|"text"|"description"} 0 - the property the filter should be applied to.
|
|
80
|
+
* @property {templateFieldFilterFunction} 1 - the filter function to apply.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A plain object represeting the information about about link that can get utilised in a template.
|
|
85
|
+
*
|
|
86
|
+
* Note that the `uri` could contain more fields - it's initialised with output from the `URI.parse()` function from the `URI` module.
|
|
87
|
+
* @typedef {Object} plainLinkInformationObject
|
|
88
|
+
* @property {string} url - the URL for the link.
|
|
89
|
+
* @property {string} text - the text for the link.
|
|
90
|
+
* @property {string} description - a description for the link.
|
|
91
|
+
* @property {Object} uri - the URL's components
|
|
92
|
+
* @property {string} url.hostname - the hostname part of the URL.
|
|
93
|
+
* @property {string} url.path - the path part of the UL, `/` for an empty path.
|
|
94
|
+
* @property {boolean} url.hasPath - whether or not the URL has a path, note that `/` is considered no path.
|
|
95
|
+
* @see {@link https://medialize.github.io/URI.js/docs.html#static-parse}
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A plain object representing the infomration extracted from a web page.
|
|
100
|
+
*
|
|
101
|
+
* Note that the `uri` could contain more fields - it's initialised with output from the `URI.parse()` function from the `URI` module.
|
|
102
|
+
* @typedef {Object} plainPageInformationObject
|
|
103
|
+
* @property {string} url - the page's URL.
|
|
104
|
+
* @property {string} title - the page's title.
|
|
105
|
+
* @property {string[]} topLevelHeadings - the text from the page's `h1` tags.
|
|
106
|
+
* @property {string[]} secondaryHeadings - text from the page's `h2` tags.
|
|
107
|
+
* @property {string} mainHeading - the text from the most semantically important heading that exists in the page.
|
|
108
|
+
* @property {Object} uri - the URL's components
|
|
109
|
+
* @property {string} url.hostname - the hostname part of the URL.
|
|
110
|
+
* @property {string} url.path - the path part of the UL, `/` for an empty path.
|
|
111
|
+
* @property {boolean} url.hasPath - whether or not the URL has a path, note that `/` is considered no path.
|
|
112
|
+
* @see {@link https://medialize.github.io/URI.js/docs.html#static-parse}
|
|
113
|
+
*/</code></pre>
|
|
114
|
+
</article>
|
|
115
|
+
</section>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<br class="clear">
|
|
125
|
+
|
|
126
|
+
<footer>
|
|
127
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Apr 15 2026 17:49:51 GMT+0100 (Irish Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
128
|
+
</footer>
|
|
129
|
+
|
|
130
|
+
<script>prettyPrint();</script>
|
|
131
|
+
<script src="scripts/polyfill.js"></script>
|
|
132
|
+
<script src="scripts/linenumber.js"></script>
|
|
133
|
+
|
|
134
|
+
<script src="scripts/search.js" defer></script>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<link type="text/css" rel="stylesheet" href="./docdash-overrides.css">
|
|
139
|
+
|
|
140
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
|
141
|
+
|
|
142
|
+
<script src="./mermaid-init.js"></script>
|
|
143
|
+
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|
package/docs/utilities.mjs.html
CHANGED
|
@@ -1,17 +1,81 @@
|
|
|
1
|
-
<!DOCTYPE html
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>utilities.mjs - @bartificer/linkify Documentation</title>
|
|
7
|
+
|
|
8
|
+
<meta name="description" content="Documentation for the @bartificer/linkify package" />
|
|
9
|
+
|
|
10
|
+
<meta name="keywords" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
|
|
11
|
+
<meta name="keyword" content="documentation, linkify, link, template, javascript, generator, npm, module, package" />
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<meta property="og:title" content="@bartificer/linkify"/>
|
|
16
|
+
<meta property="og:type" content="website"/>
|
|
17
|
+
<meta property="og:image" content=""/>
|
|
18
|
+
<meta property="og:site_name" content="@bartificer/linkify Documentation"/>
|
|
19
|
+
<meta property="og:url" content="https://bartificer.github.io/linkify/"/>
|
|
20
|
+
|
|
21
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
22
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
23
|
+
<!--[if lt IE 9]>
|
|
24
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
25
|
+
<![endif]-->
|
|
26
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
27
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
28
|
+
<script src="scripts/nav.js" defer></script>
|
|
29
|
+
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
|
|
34
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
35
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
36
|
+
<div class="navicon"></div>
|
|
37
|
+
</label>
|
|
38
|
+
|
|
39
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
40
|
+
|
|
41
|
+
<nav class="wrap">
|
|
42
|
+
|
|
43
|
+
<input type="text" id="nav-search" placeholder="Search" />
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/bartificer/linkify" target="_blank" >On GitHub</a></h2><h2><a href="https://bartificer.net/" target="_blank" >Bartificer Creations</a></h2><h3>Modules</h3><ul><li><a href="module-defaults.html">defaults</a><ul class='members'><li data-type='member'><a href="module-defaults.html#.linkTemplates">linkTemplates</a></li><li data-type='member'><a href="module-defaults.html#.smallWords">smallWords</a></li><li data-type='member'><a href="module-defaults.html#.speciallyCapitalisedWords">speciallyCapitalisedWords</a></li></ul><ul class='methods'><li data-type='method'><a href="module-defaults.html#.dataTransformer">dataTransformer</a></li></ul></li><li><a href="module-link-data.html">link-data</a></li><li><a href="module-link-template.html">link-template</a></li><li><a href="module-linkifier.html">linkifier</a></li><li><a href="module-linkify.html">linkify</a><ul class='members'><li data-type='member'><a href="module-linkify.html#.LinkData">LinkData</a></li><li data-type='member'><a href="module-linkify.html#.LinkTemplate">LinkTemplate</a></li><li data-type='member'><a href="module-linkify.html#.Linkifier">Linkifier</a></li><li data-type='member'><a href="module-linkify.html#.PageData">PageData</a></li><li data-type='member'><a href="module-linkify.html#.VERSION">VERSION</a></li><li data-type='member'><a href="module-linkify.html#.default">default</a></li><li data-type='member'><a href="module-linkify.html#.linkify">linkify</a></li></ul></li><li><a href="module-page-data.html">page-data</a></li><li><a href="module-utilities.html">utilities</a><ul class='methods'><li data-type='method'><a href="module-utilities.html#.batchFixCustomWordCases">batchFixCustomWordCases</a></li><li data-type='method'><a href="module-utilities.html#.escapeRegex">escapeRegex</a></li><li data-type='method'><a href="module-utilities.html#.extractSlug">extractSlug</a></li><li data-type='method'><a href="module-utilities.html#.regulariseWhitespace">regulariseWhitespace</a></li><li data-type='method'><a href="module-utilities.html#.stripQueryString">stripQueryString</a></li><li data-type='method'><a href="module-utilities.html#.stripUTMParameters">stripUTMParameters</a></li><li data-type='method'><a href="module-utilities.html#.toTitleCase">toTitleCase</a></li></ul></li></ul><h3>Classes</h3><ul><li><a href="module-link-data.LinkData.html">LinkData</a><ul class='methods'><li data-type='method'><a href="module-link-data.LinkData.html#asPlainObject">asPlainObject</a></li></ul></li><li><a href="module-link-template.LinkTemplate.html">LinkTemplate</a><ul class='methods'><li data-type='method'><a href="module-link-template.LinkTemplate.html#addFilter">addFilter</a></li><li data-type='method'><a href="module-link-template.LinkTemplate.html#filtersFor">filtersFor</a></li></ul></li><li><a href="module-linkifier.Linkifier.html">Linkifier</a><ul class='methods'><li data-type='method'><a href="module-linkifier.Linkifier.html#fetchPageData">fetchPageData</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#generateLink">generateLink</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplate">getTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTemplateNameForDomain">getTemplateNameForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#getTransformerForDomain">getTransformerForDomain</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerDefaultTemplateMapping">registerDefaultTemplateMapping</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTemplate">registerTemplate</a></li><li data-type='method'><a href="module-linkifier.Linkifier.html#registerTransformer">registerTransformer</a></li></ul></li><li><a href="module-page-data.PageData.html">PageData</a><ul class='methods'><li data-type='method'><a href="module-page-data.PageData.html#addSecondaryHeading">addSecondaryHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#addTopLevelHeading">addTopLevelHeading</a></li><li data-type='method'><a href="module-page-data.PageData.html#asPlainObject">asPlainObject</a></li><li data-type='method'><a href="module-page-data.PageData.html#h1">h1</a></li><li data-type='method'><a href="module-page-data.PageData.html#h2">h2</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#dataTransformer">dataTransformer</a></li><li><a href="global.html#plainLinkInformationObject">plainLinkInformationObject</a></li><li><a href="global.html#plainPageInformationObject">plainPageInformationObject</a></li><li><a href="global.html#templateFieldFilterFunction">templateFieldFilterFunction</a></li><li><a href="global.html#templateFieldFilterTuple">templateFieldFilterTuple</a></li></ul><h3>Externals</h3><ul><li><a href="module-cheerio.html">cheerio</a></li><li><a href="module-mustache.html">mustache</a></li><li><a href="module-node-fetch.html">node-fetch</a></li><li><a href="module-title-case.html">title-case</a></li><li><a href="module-urijs.html">urijs</a></li><li><a href="module-url-slug.html">url-slug</a></li></ul>
|
|
47
|
+
|
|
48
|
+
</nav>
|
|
49
|
+
|
|
50
|
+
<div id="main">
|
|
51
|
+
|
|
52
|
+
<h1 class="page-title">utilities.mjs</h1>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<section>
|
|
61
|
+
<article>
|
|
62
|
+
<pre class="prettyprint source linenums"><code>/**
|
|
4
63
|
* @file A collection of useful utility functions.
|
|
5
64
|
* @author Bart Busschots <opensource@bartificer.ie>
|
|
65
|
+
* @license MIT
|
|
6
66
|
*/
|
|
7
67
|
|
|
8
68
|
/**
|
|
9
|
-
*
|
|
69
|
+
* Utility functions, intended both for use within the core link generation code, and, by users defining their own custom templates, transformer functions, and filter functions.
|
|
70
|
+
*
|
|
71
|
+
* This module is exposed to end-users as {@link module:linkifier.Linkifier#utilities} and {@link module:linkifier.Linkifier#util}.
|
|
10
72
|
* @module utilities
|
|
11
|
-
* @requires
|
|
73
|
+
* @requires defaults
|
|
12
74
|
* @requires module:urijs
|
|
13
75
|
* @requires module:url-slug
|
|
14
76
|
* @requires module:title-case
|
|
77
|
+
* @see {@link module:linkifier.Linkifier#utilities} for the short-cut to this module exposed on the Linkifier class.
|
|
78
|
+
* @see {@link module:linkifier.Linkifier#util} for the short-cut to this module exposed on the Linkifier class.
|
|
15
79
|
*/
|
|
16
80
|
import * as defaults from './defaults.mjs';
|
|
17
81
|
import URI from 'urijs';
|
|
@@ -22,27 +86,27 @@ import * as titleCase from 'title-case';
|
|
|
22
86
|
* Regularise white space by replacing all sequences of whitespace characters with a single space and trimming leading and trailing whitespace.
|
|
23
87
|
*
|
|
24
88
|
* @param {string} text
|
|
25
|
-
* @
|
|
89
|
+
* @returns {string}
|
|
26
90
|
*/
|
|
27
91
|
export function regulariseWhitespace(text){
|
|
28
92
|
return String(text).replace(/[\s\n]+/g, ' ').trim();
|
|
29
93
|
};
|
|
30
94
|
|
|
31
95
|
/**
|
|
32
|
-
* Strip the query string from a URL.
|
|
96
|
+
* Strip the query string from a URL, if present.
|
|
33
97
|
*
|
|
34
|
-
* @param {string} url
|
|
35
|
-
* @
|
|
98
|
+
* @param {string} url - a URL with our without a query string.
|
|
99
|
+
* @returns {string} the original URL with the query string removed, if it was present.
|
|
36
100
|
*/
|
|
37
101
|
export function stripQueryString(url){
|
|
38
102
|
return URI(url).query('').toString();
|
|
39
103
|
};
|
|
40
104
|
|
|
41
105
|
/**
|
|
42
|
-
* Remove UTM parameters from the query string in a URL.
|
|
106
|
+
* Remove UTM parameters from the query string in a URL, if present.
|
|
43
107
|
*
|
|
44
|
-
* @param {string} url
|
|
45
|
-
* @
|
|
108
|
+
* @param {string} url - a URL with or without UTM parameters in the query string.
|
|
109
|
+
* @returns {string} the original URL with the UTM parameters removed, if they were present, but with any other query parameters preserved.
|
|
46
110
|
* @see {@link https://en.wikipedia.org/wiki/UTM_parameters}
|
|
47
111
|
*/
|
|
48
112
|
export function stripUTMParameters(url){
|
|
@@ -55,7 +119,7 @@ export function stripUTMParameters(url){
|
|
|
55
119
|
* _**Note:** this is not a standard Javascript feature as of April 2026, though it is coming in future versions of Javascript._
|
|
56
120
|
*
|
|
57
121
|
* @param {string} str - the string to escape.
|
|
58
|
-
* @returns {string}
|
|
122
|
+
* @returns {string} the escaped string, ready for use in a regular expression.
|
|
59
123
|
* @see {@link https://stackoverflow.com/a/3561711/174985}
|
|
60
124
|
*/
|
|
61
125
|
export function escapeRegex(str) {
|
|
@@ -63,11 +127,12 @@ export function escapeRegex(str) {
|
|
|
63
127
|
}
|
|
64
128
|
|
|
65
129
|
/**
|
|
66
|
-
* Batch-
|
|
130
|
+
* Batch-fix words with special capitalisations in a string. E.g. force `fbi` to `FBI`, `ios` to `iOS`, etc..
|
|
67
131
|
*
|
|
68
|
-
* @param {string} str - the string to apply the
|
|
69
|
-
* @param {string[]} [words] -
|
|
70
|
-
* @returns {string}
|
|
132
|
+
* @param {string} str - the string to apply the capitalisation corrections to.
|
|
133
|
+
* @param {string[]} [words] - the list of words with special capitalisations. Defaults to the default list {@link module:defaults.speciallyCapitalisedWords}.
|
|
134
|
+
* @returns {string} the original string with all occurrences of the words in the list capitalised as per the word list. All other capitatlisations will be left un-changed.
|
|
135
|
+
* @see {@link module:defaults.speciallyCapitalisedWords} for the default list of custom capitalisations.
|
|
71
136
|
*/
|
|
72
137
|
export function batchFixCustomWordCases(str, words){
|
|
73
138
|
// coerce the first argument to a string
|
|
@@ -98,12 +163,47 @@ export function batchFixCustomWordCases(str, words){
|
|
|
98
163
|
return ans;
|
|
99
164
|
}
|
|
100
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Convert a string to title case, with some custom capitalisations.
|
|
168
|
+
*
|
|
169
|
+
* This functions uses the {@link module:title-case} to perform the initial title-caseing, and then applies the custom capitalisations to fix any words with unusual capitalisation requirements.
|
|
170
|
+
* All words this mododule defies as being so-called *small words* (e.g., "the", "a" & "an") are preserved in lower case, as well as the additional words defined in {@link module:defaults.smallWords}.
|
|
171
|
+
*
|
|
172
|
+
* @param {string} str - the string to convert to title case.
|
|
173
|
+
* @param {string[]} [words] - a list of words with custom capitalisations to correct after title-casing. Defaults to {@link module:defaults.speciallyCapitalisedWords}.
|
|
174
|
+
* @returns {string} the original string converted to title case, with the custom capitalisations applied.
|
|
175
|
+
* @see {@link module:defaults.speciallyCapitalisedWords} for the default list of custom capitalisations.
|
|
176
|
+
* @see {@link module:title-case} for the Title Case module who's `titleCase()` function is used to convert to title case, and which has its own default list of small words that are preserved in lower case.
|
|
177
|
+
* @see {@link module:defaults.smallWords} for the additional list of small words that are preserved in lower case.
|
|
178
|
+
*/
|
|
179
|
+
export function toTitleCase(str, words){
|
|
180
|
+
// coerce the first argument to a string
|
|
181
|
+
let ans = String(str);
|
|
182
|
+
|
|
183
|
+
// add the additional small words
|
|
184
|
+
for (const smallWord of defaults.smallWords){
|
|
185
|
+
console.log(`adding smallWord: ${smallWord}`);
|
|
186
|
+
titleCase.SMALL_WORDS.add(smallWord);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// convert to title case
|
|
190
|
+
ans = titleCase.titleCase(ans);
|
|
191
|
+
|
|
192
|
+
// fix any words with unusual customisations
|
|
193
|
+
ans = batchFixCustomWordCases(ans, words);
|
|
194
|
+
|
|
195
|
+
// return the result
|
|
196
|
+
return ans;
|
|
197
|
+
}
|
|
198
|
+
|
|
101
199
|
/**
|
|
102
200
|
* Extract the slug from a URL and convert it to a title-case string.
|
|
103
201
|
*
|
|
104
|
-
* @param {string} url
|
|
105
|
-
* @param {string[]} [words] - a list of words with custom capitalisations to correct after title-casing.
|
|
106
|
-
* @
|
|
202
|
+
* @param {string} url - the URL to extract the slug from. The slug is taken to be the last segment of the path, with any file extension removed, and with the query string and fragment ignored.
|
|
203
|
+
* @param {string[]} [words] - a list of words with custom capitalisations to correct after title-casing. Defaults to {@link module:defaults.speciallyCapitalisedWords}.
|
|
204
|
+
* @returns {string} the slug extracted from the URL, converted to title case, with the custom capitalisations applied.
|
|
205
|
+
* @see {@link module:defaults.speciallyCapitalisedWords} for the default list of custom capitalisations.
|
|
206
|
+
* @see {@link toTitleCase} for the function used for the title-casing.
|
|
107
207
|
*/
|
|
108
208
|
export function extractSlug(url, words){
|
|
109
209
|
// TO DO - add validation
|
|
@@ -145,7 +245,39 @@ export function extractSlug(url, words){
|
|
|
145
245
|
title = titleCase.titleCase(title);
|
|
146
246
|
|
|
147
247
|
// fix any words with unusual customisations
|
|
148
|
-
title =
|
|
248
|
+
title = toTitleCase(title, words);
|
|
149
249
|
|
|
150
250
|
return title;
|
|
151
|
-
};</code></pre
|
|
251
|
+
};</code></pre>
|
|
252
|
+
</article>
|
|
253
|
+
</section>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<br class="clear">
|
|
263
|
+
|
|
264
|
+
<footer>
|
|
265
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Apr 15 2026 17:49:51 GMT+0100 (Irish Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
266
|
+
</footer>
|
|
267
|
+
|
|
268
|
+
<script>prettyPrint();</script>
|
|
269
|
+
<script src="scripts/polyfill.js"></script>
|
|
270
|
+
<script src="scripts/linenumber.js"></script>
|
|
271
|
+
|
|
272
|
+
<script src="scripts/search.js" defer></script>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
<link type="text/css" rel="stylesheet" href="./docdash-overrides.css">
|
|
277
|
+
|
|
278
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
|
279
|
+
|
|
280
|
+
<script src="./mermaid-init.js"></script>
|
|
281
|
+
|
|
282
|
+
</body>
|
|
283
|
+
</html>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
// import Linkify Lib
|
|
2
|
+
import URI from 'urijs';
|
|
2
3
|
import { linkify, LinkTemplate, LinkData } from '../dist/index.js';
|
|
3
4
|
|
|
4
5
|
// import 3rd-party library for interacting with the clipboard
|
|
5
6
|
import clipboardy from 'clipboardy';
|
|
6
7
|
|
|
8
|
+
// NOTE: this example supports one optional argument, a special-case name, if passed:
|
|
9
|
+
// 1. if there is a custom transformer defined with that name, it will be used as a one-off transformer
|
|
10
|
+
// 2. if there is a template defined with that name, it will be used as a one-off template
|
|
11
|
+
|
|
12
|
+
//
|
|
13
|
+
// === Register custom templates, transformers, etc... ===
|
|
14
|
+
//
|
|
15
|
+
|
|
7
16
|
// register a custom Markdown link template and make it the default
|
|
8
17
|
linkify.registerTemplate('md-bartificer', new LinkTemplate(
|
|
9
18
|
'[{{{text}}} — {{{uri.hostname}}}{{#uri.hasPath}}/…{{/uri.hasPath}}]({{{url}}})',
|
|
@@ -32,7 +41,22 @@ linkify.registerTemplate('md-xkcd', new LinkTemplate(
|
|
|
32
41
|
));
|
|
33
42
|
linkify.registerDefaultTemplateMapping('xkcd.com', 'md-xkcd');
|
|
34
43
|
|
|
44
|
+
// register a special Markdown template that just contains the link title, and nothing more
|
|
45
|
+
linkify.registerTemplate('md-title-only', new LinkTemplate(
|
|
46
|
+
'[{{{text}}}]({{{url}}})',
|
|
47
|
+
[
|
|
48
|
+
['url', linkify.util.stripUTMParameters],
|
|
49
|
+
['text', linkify.util.regulariseWhitespace]
|
|
50
|
+
]
|
|
51
|
+
));
|
|
52
|
+
|
|
53
|
+
// capture any templates that should be made available for special cases
|
|
54
|
+
const templates = {
|
|
55
|
+
mastodonServer: 'md-title-only'
|
|
56
|
+
}
|
|
57
|
+
|
|
35
58
|
// Cache commonly needed transforer functions to reduce code repetition
|
|
59
|
+
// NOTE: these are the transformers that are available as special cases
|
|
36
60
|
const transformers = {
|
|
37
61
|
mainHeading: function(pData){
|
|
38
62
|
return new LinkData(pData.url, pData.mainHeading);
|
|
@@ -44,6 +68,34 @@ const transformers = {
|
|
|
44
68
|
titleMinusPostscript: function(pData, postscript){
|
|
45
69
|
const regex = new RegExp(`${linkify.util.escapeRegex(postscript)}$`);
|
|
46
70
|
return new LinkData(pData.url, pData.title.replace(regex, '').trim());
|
|
71
|
+
},
|
|
72
|
+
mastodonServer: function(pData){
|
|
73
|
+
const mastodonServer = pData.uri.hostname();
|
|
74
|
+
|
|
75
|
+
// see if the link points to a user-related page on the server
|
|
76
|
+
const mastodonPathMatch = pData.uri.path().match(/^\/@(?<handle>[^\/]+)(?:\/(?<postId>\d+))?/);
|
|
77
|
+
if (mastodonPathMatch && mastodonPathMatch.groups){
|
|
78
|
+
// if so, return the handle as the link text and the post ID as the description (if there is one)
|
|
79
|
+
const handle = mastodonPathMatch.groups.handle;
|
|
80
|
+
const postId = mastodonPathMatch.groups.postId;
|
|
81
|
+
|
|
82
|
+
// see if we're a post or some kind of profile page
|
|
83
|
+
if(postId){
|
|
84
|
+
// this is a post, so use the handle and the post snippet as the text
|
|
85
|
+
|
|
86
|
+
// extract the post snippet from the title
|
|
87
|
+
let snippet = pData.title.replace(/^[^"]+"/, '').replace(/"[^"]+$/, '').trim();
|
|
88
|
+
|
|
89
|
+
return new LinkData(pData.url, `@${handle}@${mastodonServer} on Mastodon: "${snippet}"`);
|
|
90
|
+
}else{
|
|
91
|
+
// some kind of profile page, so just return the handle with some text to indicate this is a Mastodon server
|
|
92
|
+
return new LinkData(pData.url, `@${handle}@${mastodonServer} on Mastodon`);
|
|
93
|
+
}
|
|
94
|
+
return new LinkData(pData.url, pData.title, mastodonServer);
|
|
95
|
+
} else {
|
|
96
|
+
// we're on a generic page, so return the title with with a note that this is a Mastodon server
|
|
97
|
+
return new LinkData(pData.url, `${pData.title} (Mastodon)`);
|
|
98
|
+
}
|
|
47
99
|
}
|
|
48
100
|
};
|
|
49
101
|
|
|
@@ -62,6 +114,7 @@ linkify.registerTransformer('apod.nasa.gov', (pData) => {
|
|
|
62
114
|
return new LinkData(pData.url, pData.title);
|
|
63
115
|
}
|
|
64
116
|
});
|
|
117
|
+
linkify.registerTransformer('social.bartificer.ie', transformers.mastodonServer);
|
|
65
118
|
linkify.registerTransformer('cultofmac.com', transformers.mainHeading);
|
|
66
119
|
linkify.registerTransformer('daringfireball.net', (pData) => transformers.titleMinusPrefix(pData, 'Daring Fireball: '));
|
|
67
120
|
linkify.registerTransformer('intego.com', (pData) => transformers.titleMinusPostscript(pData, ' | Intego'));
|
|
@@ -87,10 +140,36 @@ linkify.registerTransformer('xkcd.com', (pData) => {
|
|
|
87
140
|
return new LinkData(pData.url, comicTitle, comicNumber);
|
|
88
141
|
});
|
|
89
142
|
|
|
143
|
+
//
|
|
144
|
+
// === Genereate the Link ===
|
|
145
|
+
//
|
|
146
|
+
|
|
90
147
|
// read the URL from the clipboard
|
|
91
148
|
let testURL = clipboardy.readSync();
|
|
92
149
|
|
|
150
|
+
// check if a specicla-case was passed
|
|
151
|
+
let specialCaseName = '';
|
|
152
|
+
let templateName = null;
|
|
153
|
+
if(process.argv.length > 2){
|
|
154
|
+
specialCaseName = String(process.argv[2]);
|
|
155
|
+
}
|
|
156
|
+
if(specialCaseName){
|
|
157
|
+
// check for a special-case transformer
|
|
158
|
+
if (transformers[specialCaseName]){
|
|
159
|
+
linkify.registerTransformer(URI(testURL).hostname(), transformers[specialCaseName]);
|
|
160
|
+
} else {
|
|
161
|
+
console.warn(`No transformer found with the name "${specialCaseName}". Proceeding without a one-off transformer.`);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// check for a special-case template
|
|
165
|
+
if(templates[specialCaseName]){
|
|
166
|
+
templateName = templates[specialCaseName];
|
|
167
|
+
} else {
|
|
168
|
+
console.warn(`No template found for special case "${specialCaseName}". Proceeding without a one-off template.`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
93
172
|
// try generate the formatted link from the URL
|
|
94
|
-
linkify.generateLink(testURL).then(function(d){
|
|
173
|
+
linkify.generateLink(testURL, templateName).then(function(d){
|
|
95
174
|
console.log(d);
|
|
96
175
|
});
|