@honkit/html 3.7.0 → 4.0.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/lib/dom.js +27 -4
- package/lib/glossary.js +5 -1
- package/lib/langs.js +1 -1
- package/lib/readme.js +5 -1
- package/lib/summary.js +5 -1
- package/package.json +4 -4
- package/CHANGELOG.md +0 -141
package/lib/dom.js
CHANGED
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.cleanup = exports.textNode = exports.root = exports.parse = void 0;
|
|
7
30
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const
|
|
31
|
+
const cheerio = __importStar(require("cheerio"));
|
|
9
32
|
/**
|
|
10
33
|
Parse an HTML string and return its content
|
|
11
34
|
|
|
12
|
-
@param
|
|
13
|
-
@return {cheerio.
|
|
35
|
+
@param html
|
|
36
|
+
@return {cheerio.Root}
|
|
14
37
|
*/
|
|
15
38
|
function parse(html) {
|
|
16
|
-
const $ =
|
|
39
|
+
const $ = cheerio.load(html, { _useHtmlParser2: true });
|
|
17
40
|
const $el = $("html, body").first();
|
|
18
41
|
return $el.length > 0 ? $el : $;
|
|
19
42
|
}
|
package/lib/glossary.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/langs.js
CHANGED
|
@@ -11,7 +11,7 @@ const summary_1 = __importDefault(require("./summary"));
|
|
|
11
11
|
@return {Array}
|
|
12
12
|
*/
|
|
13
13
|
function parseLangs(content) {
|
|
14
|
-
const parts = summary_1.default(content).parts;
|
|
14
|
+
const parts = (0, summary_1.default)(content).parts;
|
|
15
15
|
if (parts.length > 0) {
|
|
16
16
|
return parts[0].articles;
|
|
17
17
|
}
|
package/lib/readme.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/summary.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honkit/html",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Parse HTML content for gitbook",
|
|
5
5
|
"homepage": "https://github.com/honkit/honkit",
|
|
6
6
|
"bugs": {
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"prepublish": "npm run --if-present build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"cheerio": "^0.
|
|
41
|
+
"cheerio": "^1.0.0-rc.12",
|
|
42
42
|
"lodash": "^4.13.1",
|
|
43
43
|
"q": "^1.1.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"mocha": "^
|
|
46
|
+
"mocha": "^10.0.0",
|
|
47
47
|
"rimraf": "^3.0.2"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "422e59c878e8c3a65c6b80818c579a45b6647d3c"
|
|
53
53
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# 3.7.0 (2021-04-14)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* add prepublish script ([810fcc7](https://github.com/honkit/honkit/commit/810fcc7f45f3b1ab8d9527e8738f9861fdbe2c31))
|
|
12
|
-
* **honkit/html:** fix cheerio versioning ([7849651](https://github.com/honkit/honkit/commit/7849651d61a4cbd89c808f7018872d87b8409eed))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## [3.6.17](https://github.com/honkit/honkit/compare/v3.6.16...v3.6.17) (2021-02-15)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @honkit/html
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## 3.6.16 (2020-12-15)
|
|
27
|
-
|
|
28
|
-
**Note:** Version bump only for package @honkit/html
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## 3.6.15 (2020-12-05)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @honkit/html
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## 3.6.14 (2020-11-29)
|
|
43
|
-
|
|
44
|
-
**Note:** Version bump only for package @honkit/html
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## 3.6.13 (2020-11-17)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
* **honkit:** browser print layout in default theme ([#159](https://github.com/honkit/honkit/issues/159)) ([672cb9c](https://github.com/honkit/honkit/commit/672cb9c92f90dd154793b7a36d4dbf2654e7aec4))
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## 3.6.12 (2020-11-13)
|
|
62
|
-
|
|
63
|
-
**Note:** Version bump only for package @honkit/html
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## [3.5.5](https://github.com/honkit/honkit/compare/v3.5.4...v3.5.5) (2020-08-02)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
### Bug Fixes
|
|
73
|
-
|
|
74
|
-
* **honkit/html:** fix cheerio versioning ([7849651](https://github.com/honkit/honkit/commit/7849651d61a4cbd89c808f7018872d87b8409eed))
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## [3.5.4](https://github.com/honkit/honkit/compare/v3.5.3...v3.5.4) (2020-08-01)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### Bug Fixes
|
|
84
|
-
|
|
85
|
-
* add prepublish script ([810fcc7](https://github.com/honkit/honkit/commit/810fcc7f45f3b1ab8d9527e8738f9861fdbe2c31))
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## [3.5.1](https://github.com/honkit/honkit/compare/v3.5.0...v3.5.1) (2020-07-04)
|
|
92
|
-
|
|
93
|
-
**Note:** Version bump only for package @honkit/html
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
## [3.4.1](https://github.com/honkit/honkit/compare/v3.4.0...v3.4.1) (2020-06-29)
|
|
100
|
-
|
|
101
|
-
**Note:** Version bump only for package @honkit/html
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
## [3.3.11](https://github.com/honkit/honkit/compare/v3.3.10...v3.3.11) (2020-06-27)
|
|
108
|
-
|
|
109
|
-
**Note:** Version bump only for package @honkit/html
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
## [3.3.8](https://github.com/honkit/honkit/compare/v3.3.7...v3.3.8) (2020-06-18)
|
|
116
|
-
|
|
117
|
-
**Note:** Version bump only for package @honkit/html
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
## [3.3.7](https://github.com/honkit/honkit/compare/v3.3.6...v3.3.7) (2020-06-18)
|
|
124
|
-
|
|
125
|
-
**Note:** Version bump only for package @honkit/html
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## [3.3.4](https://github.com/honkit/honkit/compare/v3.3.3...v3.3.4) (2020-06-17)
|
|
132
|
-
|
|
133
|
-
**Note:** Version bump only for package @honkit/html
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# 3.3.0 (2020-06-14)
|
|
140
|
-
|
|
141
|
-
**Note:** Version bump only for package @honkit/html
|