You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working with the Modify Token plugin and I have a function that reads the image a embeds it as a data-uri using this plugin.
Here is the code:
varmodifyTokenFunction=function(token,env){switch(token.type){case'image':
console.log(path.dirname(env.path)+'/'+token.attrObj.src)letext=path.extname(env.path);console.log('Encoding file: '+path.dirname(env.path)+'/'+token.attrObj.src+'...')token.attrObj.src=datauri.format(ext,fs.readFileSync(path.dirname(env.path)+'/'+token.attrObj.src)).contentbreak;case'link_open':
token.attrObj.target='_blank';// set all links to open in new window break;}};
This does serialize the video as data-uri correctly, but render as <img> and your plugin is never called.
The trouble is that you are using the image syntax, so the case in my function is being hit, ideally I think you should use a different syntax, @[]() is used in the video plugin.
I believe I might be able to use customRenderFn to serialise as data-url, but I also need to stop the modify plugin being called.
Can you see what I am doing here? Any ideas?
The text was updated successfully, but these errors were encountered:
Hello there,
I am working with the Modify Token plugin and I have a function that reads the image a embeds it as a data-uri using this plugin.
Here is the code:
This does serialize the video as data-uri correctly, but render as
<img>
and your plugin is never called.The trouble is that you are using the image syntax, so the case in my function is being hit, ideally I think you should use a different syntax,
@[]()
is used in the video plugin.I believe I might be able to use
customRenderFn
to serialise as data-url, but I also need to stop the modify plugin being called.Can you see what I am doing here? Any ideas?
The text was updated successfully, but these errors were encountered: