Skip to content

Commit 0552e7b

Browse files
committed
Rebuild docs
1 parent 7f65796 commit 0552e7b

File tree

13 files changed

+82
-51
lines changed

13 files changed

+82
-51
lines changed

dist/Autolinker.js

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Autolinker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Autolinker.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Autolinker.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Autolinker v1.8.3 API Docs</title>
4+
<title>Autolinker v2.0.0 API Docs</title>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<meta http-equiv="X-UA-Compatible" content="chrome=1">
77
<meta name="fragment" content="!">
@@ -22,9 +22,9 @@
2222
</head>
2323
<body id="ext-body">
2424

25-
<div id="loading"><span class="title">Autolinker v1.8.3 API Docs</span><span class="logo"></span></div>
25+
<div id="loading"><span class="title">Autolinker v2.0.0 API Docs</span><span class="logo"></span></div>
2626

27-
<div id="header-content">Autolinker v1.8.3 API Docs</div>
27+
<div id="header-content">Autolinker v2.0.0 API Docs</div>
2828

2929
<div id='categories-content' style='display:none'>
3030
<div class='section'>
@@ -88,7 +88,7 @@ <h3>Others...</h3>
8888

8989

9090

91-
<div id='footer-content' style='display: none'>Generated on Wed 26 Dec 2018 17:42:01 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 5.3.4.</div>
91+
<div id='footer-content' style='display: none'>Generated on Thu 27 Dec 2018 17:38:33 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 5.3.4.</div>
9292

9393

9494

docs/api/output/Autolinker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/output/global.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/source/Autolinker.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,17 @@
406406
* Note: this is lazily instantiated in the {@link #getTagBuilder} method.
407407
*/
408408
this.tagBuilder = null;
409+
// Note: when `this.something` is used in the rhs of these assignments,
410+
// it refers to the default values set above the constructor
409411
this.urls = this.normalizeUrlsCfg(cfg.urls);
410-
this.email = typeof cfg.email === &#39;boolean&#39; ? cfg.email : true;
411-
this.phone = typeof cfg.phone === &#39;boolean&#39; ? cfg.phone : true;
412-
this.hashtag = cfg.hashtag || false;
413-
this.mention = cfg.mention || false;
414-
this.newWindow = typeof cfg.newWindow === &#39;boolean&#39; ? cfg.newWindow : true;
412+
this.email = typeof cfg.email === &#39;boolean&#39; ? cfg.email : this.email;
413+
this.phone = typeof cfg.phone === &#39;boolean&#39; ? cfg.phone : this.phone;
414+
this.hashtag = cfg.hashtag || this.hashtag;
415+
this.mention = cfg.mention || this.mention;
416+
this.newWindow = typeof cfg.newWindow === &#39;boolean&#39; ? cfg.newWindow : this.newWindow;
415417
this.stripPrefix = this.normalizeStripPrefixCfg(cfg.stripPrefix);
416-
this.stripTrailingSlash = typeof cfg.stripTrailingSlash === &#39;boolean&#39; ? cfg.stripTrailingSlash : true;
417-
this.decodePercentEncoding = typeof cfg.decodePercentEncoding === &#39;boolean&#39; ? cfg.decodePercentEncoding : true;
418+
this.stripTrailingSlash = typeof cfg.stripTrailingSlash === &#39;boolean&#39; ? cfg.stripTrailingSlash : this.stripTrailingSlash;
419+
this.decodePercentEncoding = typeof cfg.decodePercentEncoding === &#39;boolean&#39; ? cfg.decodePercentEncoding : this.decodePercentEncoding;
418420
// Validate the value of the `mention` cfg
419421
var mention = this.mention;
420422
if (mention !== false &amp;&amp; mention !== &#39;twitter&#39; &amp;&amp; mention !== &#39;instagram&#39; &amp;&amp; mention !== &#39;soundcloud&#39;) {
@@ -426,8 +428,8 @@
426428
throw new Error(&quot;invalid `hashtag` cfg - see docs&quot;);
427429
}
428430
this.truncate = this.normalizeTruncateCfg(cfg.truncate);
429-
this.className = cfg.className || &#39;&#39;;
430-
this.replaceFn = cfg.replaceFn || null;
431+
this.className = cfg.className || this.className;
432+
this.replaceFn = cfg.replaceFn || this.replaceFn;
431433
this.context = cfg.context || this;
432434
}
433435
<span id='Autolinker-static-method-link'> /**
@@ -593,21 +595,21 @@
593595
* given input `textOrHtml`.
594596
*/
595597
Autolinker.prototype.parse = function (textOrHtml) {
596-
var htmlNodes = this.htmlParser.parse(textOrHtml), anchorTagStackCount = 0, // used to only process text around anchor tags, and any inner text/html they may have;
598+
var htmlNodes = this.htmlParser.parse(textOrHtml), skipTagNames = [&#39;a&#39;, &#39;style&#39;, &#39;script&#39;], skipTagsStackCount = 0, // used to only Autolink text outside of anchor/script/style tags. We don&#39;t want to autolink something that is already linked inside of an &lt;a&gt; tag, for instance
597599
matches = [];
598600
// Find all matches within the `textOrHtml` (but not matches that are
599601
// already nested within &lt;a&gt;, &lt;style&gt; and &lt;script&gt; tags)
600602
for (var i = 0, len = htmlNodes.length; i &lt; len; i++) {
601603
var node = htmlNodes[i], nodeType = node.getType();
602-
if (nodeType === &#39;element&#39; &amp;&amp; [&#39;a&#39;, &#39;style&#39;, &#39;script&#39;].indexOf(node.getTagName()) !== -1) { // Process HTML anchor, style and script element nodes in the input `textOrHtml` to find out when we&#39;re within an &lt;a&gt;, &lt;style&gt; or &lt;script&gt; tag
604+
if (nodeType === &#39;element&#39; &amp;&amp; skipTagNames.indexOf(node.getTagName()) !== -1) { // Process HTML anchor, style and script element nodes in the input `textOrHtml` to find out when we&#39;re within an &lt;a&gt;, &lt;style&gt; or &lt;script&gt; tag
603605
if (!node.isClosing()) { // it&#39;s the start &lt;a&gt;, &lt;style&gt; or &lt;script&gt; tag
604-
anchorTagStackCount++;
606+
skipTagsStackCount++;
605607
}
606608
else { // it&#39;s the end &lt;/a&gt;, &lt;/style&gt; or &lt;/script&gt; tag
607-
anchorTagStackCount = Math.max(anchorTagStackCount - 1, 0); // attempt to handle extraneous &lt;/a&gt; tags by making sure the stack count never goes below 0
609+
skipTagsStackCount = Math.max(skipTagsStackCount - 1, 0); // attempt to handle extraneous &lt;/a&gt; tags by making sure the stack count never goes below 0
608610
}
609611
}
610-
else if (nodeType === &#39;text&#39; &amp;&amp; anchorTagStackCount === 0) { // Process text nodes that are not within an &lt;a&gt;, &lt;style&gt; and &lt;script&gt; tag
612+
else if (nodeType === &#39;text&#39; &amp;&amp; skipTagsStackCount === 0) { // Process text nodes that are not within an &lt;a&gt;, &lt;style&gt; and &lt;script&gt; tag
611613
var textNodeMatches = this.parseText(node.getText(), node.getOffset());
612614
matches.push.apply(matches, textNodeMatches);
613615
}
@@ -844,7 +846,7 @@
844846
*
845847
* Ex: 0.25.1
846848
*/
847-
Autolinker.version = &#39;1.8.3&#39;;
849+
Autolinker.version = &#39;2.0.0&#39;;
848850
<span id='Autolinker-AnchorTagBuilder'> /**
849851
</span> * For backwards compatibility with Autolinker 1.x, the AnchorTagBuilder
850852
* class is provided as a static on the Autolinker class.

docs/api/source/env.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>The source code</title>
6+
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7+
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8+
<style type="text/css">
9+
.highlight { display: block; background-color: #ddd; }
10+
</style>
11+
<script type="text/javascript">
12+
function highlight() {
13+
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14+
}
15+
</script>
16+
</head>
17+
<body onload="prettyPrint(); highlight();">
18+
<pre class="prettyprint lang-js">&quot;use strict&quot;;
19+
Object.defineProperty(exports, &quot;__esModule&quot;, { value: true });
20+
exports.env = {};
21+
22+
//# sourceMappingURL=env.js.map
23+
</pre>
24+
</body>
25+
</html>

docs/dist/Autolinker.js

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/Autolinker.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<!-- This references the 'dist' folder from the '/docs/examples' folder
1717
where it is deployed on GitHub pages -->
18-
<script src="../dist/autolinker.js"></script>
18+
<script src="../dist/Autolinker.min.js"></script>
1919
<script src="live-example.js"></script> <!-- This file is created at build time -->
2020
</head>
2121

src/autolinker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import { MentionMatcher } from "./matcher/mention-matcher";
9191
* }
9292
*
9393
* case 'phone' :
94-
* var phoneNumber = match.getPhoneNumber();
94+
* var phoneNumber = match.getNumber();
9595
* console.log( phoneNumber );
9696
*
9797
* return '<a href="http://newplace.to.link.phone.numbers.to/">' + phoneNumber + '</a>';

0 commit comments

Comments
 (0)