Closed aamorozov closed 4 years ago
I think we can use the offset and the length fields within the entityRange object to make it work
"entityRanges": [
{
"offset": 29,
"length": 4,
"key": 0
}
]
The offset points to the character that is at the start of the link and the length is well, the length of the link text.
Feature was added in d273728ad2b1b02bd179e048d42c11f6f584a193
We're mapping the entityMap (Link data) to the block's entityRanges( link text) based on the key. Looks like when the links are inlined within the paragraph, the link tag is being applied to the whole paragraph. I will add an output from draftail showing that issue shortly.
https://github.com/hzdg/hz-core/blob/master/packages/ui-components/hzcore-draftail-renderer/src/index.tsx#L193-L242