LinkButton Text

Digital Product Launch Template

o que fazer em aracaju sergipe pontos turísticos melhores praias

:
Apple Users On Launch Day
update voby-via-demo
1 parent News Or Blogs Web Design Ideas commit 2a69170

O que fazer em aracaju sergipe pontos turísticos melhores praias 3 files changed Product Launch Event Presentation

Lines changed: 23 additions & 21 deletions

Icon Produkti Digital Product Launch Template

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"amdName": "vhtml",
44
"version": "2.2.1",
55
"description": "Hyperscript reviver that constructs a sanitized HTML string.",
6-
"main": "dist/vhtml.js",
7-
"minified:main": "dist/vhtml.min.js",
8-
"jsnext:main": "src/vhtml.js",
6+
"main": "./dist/vhtml.js",
7+
"minified:main": "./dist/vhtml.umd.js",
8+
"jsnext:main": "./src/vhtml.ts",
99
"scripts": {
1010
"preinstall": "npx only-allow pnpm",
1111
"build": "vite build && tsc --declaration && pnpm size",

src/vhtml.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,26 @@ export default function h(name: string | Function | null, attrs: any, ..._args:
2626
// return name(attrs, stack.reverse());
2727
}
2828

29+
const loopAttr = () => {
30+
if (attrs) for (let i in attrs) {
31+
if (attrs[i] !== false && attrs[i] != null && i !== setInnerHTMLAttr) {
32+
//@ts-ignore
33+
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`
34+
}
35+
}
36+
}
37+
2938
if (name) {
3039
if (name === '!') {
3140
s += '<!-- '
32-
if (attrs) for (let i in attrs) {
33-
if (attrs[i] !== false && attrs[i] != null && i !== setInnerHTMLAttr) {
34-
//@ts-ignore
35-
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`
36-
}
37-
}
41+
loopAttr()
3842
}
3943
else if (name === 'text') {
40-
if (attrs) for (let i in attrs) {
41-
if (attrs[i] !== false && attrs[i] != null && i !== setInnerHTMLAttr) {
42-
//@ts-ignore
43-
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`
44-
}
45-
}
44+
loopAttr()
4645
}
4746
else {
4847
s += '<' + name
49-
if (attrs) for (let i in attrs) {
50-
if (attrs[i] !== false && attrs[i] != null && i !== setInnerHTMLAttr) {
51-
//@ts-ignore
52-
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`
53-
}
54-
}
48+
loopAttr()
5549
s += '>'
5650
}
5751
}

test/vhtml.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ describe('vhtml', () => {
4545
)
4646
})
4747

48+
// it('should sanitize function', () => {
49+
// expect(
50+
// <div onClick={() => alert('hello')} />
51+
// ).to.equal(
52+
// `<div onclick="&amp;&lt;&gt;&quot;&apos;"></div>`
53+
// )
54+
// })
55+
4856
it('should not sanitize the "dangerouslySetInnerHTML" attribute, and directly set its `__html` property as innerHTML', () => {
4957
expect(
5058
<div dangerouslySetInnerHTML={{ __html: "<span>Injected HTML</span>" }} />

Business Cards Miami Digital Product Launch Template

Comments
 (0)