@nerimity/html-embed 1.1.14 → 1.1.16
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/dist/index.js +1 -1
- package/package.json +23 -23
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.htmlToJson = htmlToJson;
|
|
|
7
7
|
const htm_1 = __importDefault(require("htm"));
|
|
8
8
|
const css_1 = __importDefault(require("css"));
|
|
9
9
|
const { validate } = require("csstree-validator");
|
|
10
|
-
const allowedTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'img', 'span', 'strong', 'a', "style", "p", "ul", "li", "ol", "table", "thead", "tbody", "tr", "td", "th", "blockquote", "pre", "br"];
|
|
10
|
+
const allowedTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'img', 'span', 'strong', 'a', "style", "p", "ul", "li", "ol", "table", "thead", "tbody", "tr", "td", "th", "blockquote", "pre", "br", 'b', 'i', 'u', 'em', 'small', 'mark', 'sub', 'sup', 'code', 'hr', 'section', 'article', 'header', 'footer', 'nav'];
|
|
11
11
|
const allowedAttributes = ["href", "src", "color", "style", "class"];
|
|
12
12
|
const allowedCssProperties = [
|
|
13
13
|
"background-clip",
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nerimity/html-embed",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@nerimity/html-embed",
|
|
3
|
+
"version": "1.1.16",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@types/css": "^0.0.37",
|
|
11
|
+
"@types/node": "^22.10.10",
|
|
12
|
+
"typescript": "^5.5.2"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"css": "^3.0.0",
|
|
16
|
+
"csstree-validator": "^4.0.1",
|
|
17
|
+
"htm": "^3.1.0"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"example": "tsc & node example.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import css from 'css';
|
|
|
3
3
|
const {validate} = require("csstree-validator")
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const allowedTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'img', 'span', 'strong', 'a', "style", "p", "ul", "li", "ol", "table", "thead", "tbody", "tr", "td", "th", "blockquote", "pre", "br"]
|
|
6
|
+
const allowedTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'img', 'span', 'strong', 'a', "style", "p", "ul", "li", "ol", "table", "thead", "tbody", "tr", "td", "th", "blockquote", "pre", "br", 'b', 'i', 'u', 'em', 'small', 'mark', 'sub', 'sup', 'code', 'hr', 'section', 'article', 'header', 'footer', 'nav'];
|
|
7
7
|
const allowedAttributes = ["href", "src", "color", "style", "class"]
|
|
8
8
|
const allowedCssProperties = [
|
|
9
9
|
"background-clip",
|
|
@@ -179,4 +179,4 @@ function cssNameToJsName(name: string) {
|
|
|
179
179
|
function jsNameToCssName(name: string)
|
|
180
180
|
{
|
|
181
181
|
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
182
|
-
}
|
|
182
|
+
}
|