CustomEntityTransform does not work properly
victors1682 opened this issue · comments
Victor Santos commented
I've been attempting to apply a custom transformation, but I'm facing difficulties in getting it to work. We previously applied the transformation to the same element using 'draft-js' and 'draft-js-export-html'.
Testing
const draftToHtml = require("draftjs-to-html")
const data = {
blocks: [
{
key: '123',
text: 'My Heading',
type: 'header-one',
depth: 0,
inlineStyleRanges: [],
entityRanges: [],
data: {}
}
],
entityMap: {}
}
const customEntityTransform = (data) => {
return "<h1> Transformed: "+data+"</h1>"
}
const result = draftToHtml(data, undefined, false, customEntityTransform)
console.log(result)