-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
The readme has the following example:
entityToHTML: (entity, originalText) => {
if (entity.type === 'LINK') {
return <a href={entity.data.url}>{originalText}</a>;
}
return originalText;
}
This works fine, however the originalText appears to be already HTML encoded and therefore if it contains special characters like an ' it will be double encoded.
E.g. originalText = my'url will result in the HTML <a href="https://google.ch">my&#x27;url</a>
As a workaround I changed the function to that:
if (entity.type === 'LINK') {
return <a href={entity.data.url} />;
}
return originalText;
Now the resulting HTML will be <a href="https://google.ch">my'url</a> (because of the way the getElementHTML function works).
Not sure if this workaround is correct and can be used like this but it appears to work. I guess if the getElementHTML will never change I can leave my workaround...
Also not sure if I'm doing something wrong or if this is an actual bug.
Metadata
Metadata
Assignees
Labels
No labels