UNPKG

@hedgedoc/html-to-react

Version:

Parse HTML into React components

15 lines 610 B
import { mapHtmlAttributesToReactElementAttributes } from './mapHtmlAttributesToReactElementAttributes.js'; import { convertInlineStyleToMap } from './convertInlineStyleToMap.js'; export function generatePropsFromAttributes(attributes, key) { const props = Object.assign({ key }, mapHtmlAttributesToReactElementAttributes(attributes)); if (props.style) { if (typeof props.style === 'string') { props.style = convertInlineStyleToMap(props.style); } } else { delete props.style; } return props; } //# sourceMappingURL=generatePropsFromAttributes.js.map