Skip to content

Commit 5913c67

Browse files
committed
version 0.0.7
1 parent 69899cc commit 5913c67

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
};
3030
```
3131

32-
After `webpack.config.js` has been changed, in js files (for example, in `main.js`), you can import a file with the `.hmpl` extension and receive a [template function](https://spec.hmpl-lang.dev/#template-function) in response.
32+
After `webpack.config.js` has been changed, in js files (for example, in `main.js`), you can import a file with the `.hmpl` extension and receive a [template function](https://hmpl-lang.dev/functions/template/) in response.
3333

3434
### main.hmpl
3535

@@ -62,9 +62,11 @@ module.exports = {
6262
loader: "hmpl-loader",
6363
options: {
6464
memo: true,
65-
autoBody: {
66-
formData: true,
67-
},
65+
autoBody: { formData: true },
66+
allowedContentTypes: ["text/html"],
67+
disallowedTags: ["script"],
68+
sanitize: false,
69+
sanitizeConfig: { USE_PROFILES: { html: true } },
6870
},
6971
},
7072
},
@@ -73,7 +75,7 @@ module.exports = {
7375
};
7476
```
7577

76-
The list of options is described in the documentation [here](https://spec.hmpl-lang.dev/#options).
78+
The list of options is described in the documentation [here](https://hmpl-lang.dev/objects/hmpl/#compile).
7779

7880
## Changelog
7981

index.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,52 @@ const schema = {
77
memo: {
88
type: "boolean",
99
},
10+
1011
autoBody: {
1112
anyOf: [
13+
{
14+
type: "boolean",
15+
},
1216
{
1317
type: "object",
1418
properties: {
15-
formData: {
16-
type: "boolean",
17-
},
19+
formData: { type: "boolean" },
1820
},
1921
additionalProperties: false,
2022
},
21-
{ type: "boolean" },
2223
],
2324
},
25+
2426
allowedContentTypes: {
2527
anyOf: [
2628
{
2729
type: "array",
28-
items: {
29-
type: "string",
30-
},
30+
items: { type: "string" },
3131
},
3232
{
33+
type: "string",
3334
enum: ["*"],
3435
},
3536
],
3637
},
38+
3739
sanitize: {
3840
type: "boolean",
3941
},
42+
4043
disallowedTags: {
4144
type: "array",
4245
items: {
4346
enum: ["script", "style", "iframe"],
4447
},
4548
},
49+
50+
sanitizeConfig: {
51+
type: "object",
52+
additionalProperties: true,
53+
},
4654
},
55+
4756
additionalProperties: false,
4857
};
4958

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hmpl-loader",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "Loader for files with hpml extension for webpack",
55
"main": "index.js",
66
"scripts": {},

0 commit comments

Comments
 (0)