Skip to content

Commit

Permalink
feat: Added $html property
Browse files Browse the repository at this point in the history
  • Loading branch information
sooophies committed Sep 30, 2023
1 parent 0905e9b commit 1d41ef3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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[]} */ ([]);
Expand Down

0 comments on commit 1d41ef3

Please sign in to comment.