From 1d41ef3b7d8b7a12a33c0a4f48ac44d3748ad8fe Mon Sep 17 00:00:00 2001 From: typable Date: Sat, 30 Sep 2023 23:44:11 +0200 Subject: [PATCH] feat: Added $html property --- lib.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib.js b/lib.js index 8a7f46d..b9ee7d6 100644 --- a/lib.js +++ b/lib.js @@ -262,6 +262,11 @@ export default function figure(create) { props[key] = prop; } } + const htmlMatch = /^\$html$/.exec(attr); + if (htmlMatch) { + // bind inner html + props['dangerouslySetInnerHTML'] = { __html: value }; + } props[attr] = value instanceof Array ? value.join('') : value; } const children = /** @type {ReactElement[]} */ ([]);