fix custom link attribute

This commit is contained in:
btzr-io 2019-06-09 01:14:27 -06:00
parent 05e4f87707
commit 9372c19b00

View file

@ -8,7 +8,10 @@ const locateMention = (value, fromIndex) => value.indexOf('@', fromIndex);
const createURI = (text, uri, autoEmbed = false) => ({
type: 'link',
url: (uri.startsWith(protocol) ? '' : protocol) + uri,
data: { hProperties: { dataPreview: autoEmbed } },
data: {
// Custom attribute
hProperties: { 'data-preview': autoEmbed },
},
children: [{ type: 'text', value: text }],
});