@pi-r/posthtml 0.11.2 → 0.12.0
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 +4 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const { loadPlugins } = require('@e-mc/document/util');
|
|
3
4
|
async function transform(context, value, options) {
|
|
4
5
|
const external = options.external;
|
|
5
6
|
const baseConfig = options.toBaseConfig(false);
|
|
@@ -17,10 +18,11 @@ async function transform(context, value, options) {
|
|
|
17
18
|
}
|
|
18
19
|
if (Array.isArray(plugins)) {
|
|
19
20
|
delete baseConfig.plugins;
|
|
20
|
-
const result = await context(
|
|
21
|
+
const result = await context(loadPlugins(plugins)).process(value, baseConfig);
|
|
21
22
|
if (result) {
|
|
22
23
|
return result.html;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
module.exports = transform;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/posthtml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "PostHTML transform function for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/document": "^0.
|
|
22
|
+
"@e-mc/document": "^0.14.0",
|
|
23
23
|
"posthtml": "^0.16.7"
|
|
24
24
|
}
|
|
25
25
|
}
|