Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/vhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ let DOMAttributeNames = {

let sanitized = {};

export const Fragment = ({ children }: { children: string[] }) => h(null as any, null, ...children);

/** Hyperscript reviver that constructs a sanitized HTML string. */
export default function h(name, attrs) {
function h(name, attrs) {
let stack=[], s = '';
attrs = attrs || {};
for (let i=arguments.length; i-- > 2; ) {
Expand Down Expand Up @@ -58,3 +60,7 @@ export default function h(name, attrs) {
sanitized[s] = true;
return s;
}

h.Fragment = Fragment;

export default h