@pi-r/html-validate 0.11.3 → 0.12.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/index.js +5 -3
- package/package.json +3 -6
package/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
const
|
|
2
|
+
|
|
3
|
+
const Document = require('@e-mc/document');
|
|
4
|
+
const removeQuotes = (value) => value.at(0) === '"' && value.at(-1) === '"' ? value.slice(1, -1) : value;
|
|
4
5
|
async function transform(context, value, options) {
|
|
5
6
|
context = options.upgrade(context, __dirname);
|
|
6
7
|
const { pathname, filename } = options;
|
|
7
8
|
const baseConfig = options.toBaseConfig();
|
|
8
|
-
baseConfig.root = true;
|
|
9
9
|
const timeStamp = Date.now();
|
|
10
|
+
baseConfig.root = true;
|
|
10
11
|
const report = await new context.HtmlValidate(baseConfig).validateString(value);
|
|
11
12
|
if (!report.valid) {
|
|
12
13
|
options.out[Document.hasLogType(32768) ? 'logQueued' : 'logAppend'] = Document.generateLintTable(report.results[0].messages.map(item => ({
|
|
@@ -22,4 +23,5 @@ async function transform(context, value, options) {
|
|
|
22
23
|
}
|
|
23
24
|
return value;
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
module.exports = transform;
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/html-validate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "html-validate transform function for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
6
|
"repository": {
|
|
10
7
|
"type": "git",
|
|
11
8
|
"url": "git+https://github.com/anpham6/pi-r.git",
|
|
@@ -19,7 +16,7 @@
|
|
|
19
16
|
"license": "MIT",
|
|
20
17
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
21
18
|
"dependencies": {
|
|
22
|
-
"@e-mc/document": "^0.
|
|
23
|
-
"html-validate": "^10.
|
|
19
|
+
"@e-mc/document": "^0.14.1",
|
|
20
|
+
"html-validate": "^10.15.0"
|
|
24
21
|
}
|
|
25
22
|
}
|