UNPKG

@hedgedoc/html-to-react

Version:

Parse HTML into React components

19 lines 891 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generatePropsFromAttributes = void 0; const mapHtmlAttributesToReactElementAttributes_js_1 = require("./mapHtmlAttributesToReactElementAttributes.js"); const convertInlineStyleToMap_js_1 = require("./convertInlineStyleToMap.js"); function generatePropsFromAttributes(attributes, key) { const props = Object.assign({ key }, (0, mapHtmlAttributesToReactElementAttributes_js_1.mapHtmlAttributesToReactElementAttributes)(attributes)); if (props.style) { if (typeof props.style === 'string') { props.style = (0, convertInlineStyleToMap_js_1.convertInlineStyleToMap)(props.style); } } else { delete props.style; } return props; } exports.generatePropsFromAttributes = generatePropsFromAttributes; //# sourceMappingURL=generatePropsFromAttributes.js.map