Skip to content

Commit 4a70513

Browse files
committed
WIP fixing tests
1 parent 596348e commit 4a70513

36 files changed

+260
-277
lines changed

.github/main.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
8-
9-
workflow_dispatch:
10-
1+
name: run-tests
2+
on: [push]
113
jobs:
124
build:
135
runs-on: ubuntu-latest
14-
156
steps:
167
- uses: actions/checkout@v2
17-
18-
- name: Yarn install
8+
- uses: actions/setup-node@v2
9+
with:
10+
node-version: '14'
11+
- name: yarn install
1912
run: yarn
20-
21-
- name: Yarn test
22-
run: yarn test
13+
- name: yarn test
14+
run: yarn test

dist/Autolinker.js

Lines changed: 49 additions & 35 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: 0 additions & 25 deletions
This file was deleted.

dist/Autolinker.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

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 v3.14.3 API Docs</title>
4+
<title>Autolinker v3.15.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 v3.14.3 API Docs</span><span class="logo"></span></div>
25+
<div id="loading"><span class="title">Autolinker v3.15.0 API Docs</span><span class="logo"></span></div>
2626

27-
<div id="header-content">Autolinker v3.14.3 API Docs</div>
27+
<div id="header-content">Autolinker v3.15.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 Sun 14 Mar 2021 16:46:03 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 5.3.4.</div>
91+
<div id='footer-content' style='display: none'>Generated on Fri 25 Feb 2022 15:18:32 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: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@
565565
return { length: truncate, location: &#39;end&#39; };
566566
}
567567
else { // object, or undefined/null
568-
return utils_1.defaults(truncate || {}, {
568+
return (0, utils_1.defaults)(truncate || {}, {
569569
length: Number.POSITIVE_INFINITY,
570570
location: &#39;end&#39;
571571
});
@@ -608,7 +608,7 @@
608608
matches = [];
609609
// Find all matches within the `textOrHtml` (but not matches that are
610610
// already nested within &lt;a&gt;, &lt;style&gt; and &lt;script&gt; tags)
611-
parse_html_1.parseHtml(textOrHtml, {
611+
(0, parse_html_1.parseHtml)(textOrHtml, {
612612
onOpenTag: function (tagName) {
613613
if (skipTagNames.indexOf(tagName) &gt;= 0) {
614614
skipTagsStackCount++;
@@ -623,7 +623,7 @@
623623
// TODO: Handle HTML entities separately in parseHtml() and
624624
// don&#39;t emit them as &quot;text&quot; except for &amp;amp; entities
625625
var htmlCharacterEntitiesRegex = /(&amp;nbsp;|&amp;#160;|&amp;lt;|&amp;#60;|&amp;gt;|&amp;#62;|&amp;quot;|&amp;#34;|&amp;#39;)/gi;
626-
var textSplit = utils_1.splitAndCapture(text, htmlCharacterEntitiesRegex);
626+
var textSplit = (0, utils_1.splitAndCapture)(text, htmlCharacterEntitiesRegex);
627627
var currentOffset_1 = offset;
628628
textSplit.forEach(function (splitText, i) {
629629
// even number matches are text, odd numbers are html entities
@@ -668,7 +668,8 @@
668668
Autolinker.prototype.compactMatches = function (matches) {
669669
// First, the matches need to be sorted in order of offset
670670
matches.sort(function (a, b) { return a.getOffset() - b.getOffset(); });
671-
for (var i = 0; i &lt; matches.length - 1; i++) {
671+
var i = 0;
672+
while (i &lt; matches.length - 1) {
672673
var match = matches[i], offset = match.getOffset(), matchedTextLength = match.getMatchedText().length, endIdx = offset + matchedTextLength;
673674
if (i + 1 &lt; matches.length) {
674675
// Remove subsequent matches that equal offset with current match
@@ -680,8 +681,10 @@
680681
// Remove subsequent matches that overlap with the current match
681682
if (matches[i + 1].getOffset() &lt; endIdx) {
682683
matches.splice(i + 1, 1);
684+
continue;
683685
}
684686
}
687+
i++;
685688
}
686689
return matches;
687690
};
@@ -705,21 +708,21 @@
705708
*/
706709
Autolinker.prototype.removeUnwantedMatches = function (matches) {
707710
if (!this.hashtag)
708-
utils_1.remove(matches, function (match) { return match.getType() === &#39;hashtag&#39;; });
711+
(0, utils_1.remove)(matches, function (match) { return match.getType() === &#39;hashtag&#39;; });
709712
if (!this.email)
710-
utils_1.remove(matches, function (match) { return match.getType() === &#39;email&#39;; });
713+
(0, utils_1.remove)(matches, function (match) { return match.getType() === &#39;email&#39;; });
711714
if (!this.phone)
712-
utils_1.remove(matches, function (match) { return match.getType() === &#39;phone&#39;; });
715+
(0, utils_1.remove)(matches, function (match) { return match.getType() === &#39;phone&#39;; });
713716
if (!this.mention)
714-
utils_1.remove(matches, function (match) { return match.getType() === &#39;mention&#39;; });
717+
(0, utils_1.remove)(matches, function (match) { return match.getType() === &#39;mention&#39;; });
715718
if (!this.urls.schemeMatches) {
716-
utils_1.remove(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;scheme&#39;; });
719+
(0, utils_1.remove)(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;scheme&#39;; });
717720
}
718721
if (!this.urls.wwwMatches) {
719-
utils_1.remove(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;www&#39;; });
722+
(0, utils_1.remove)(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;www&#39;; });
720723
}
721724
if (!this.urls.tldMatches) {
722-
utils_1.remove(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;tld&#39;; });
725+
(0, utils_1.remove)(matches, function (m) { return m.getType() === &#39;url&#39; &amp;&amp; m.getUrlMatchType() === &#39;tld&#39;; });
723726
}
724727
return matches;
725728
};
@@ -884,7 +887,7 @@
884887
*
885888
* Ex: 0.25.1
886889
*/
887-
Autolinker.version = &#39;3.14.3&#39;;
890+
Autolinker.version = &#39;3.15.0&#39;;
888891
<span id='Autolinker-AnchorTagBuilder'> /**
889892
</span> * For backwards compatibility with Autolinker 1.x, the AnchorTagBuilder
890893
* class is provided as a static on the Autolinker class.

0 commit comments

Comments
 (0)