Open jywarren opened 6 years ago
Could we insert a catch here:
and defer to a custom mergeHtmlAndAttachment
or corresponding mergeMarkdownAndAttachment
at that point instead of going to renderLink
?
@bevacqua what do you think about this way forward? Thanks!
It sounds like you want a different function that lets you add custom handling of links, that could be used internally to manage attachments, and exposed so that people can add their own kinds of special "attachment" links
that sounds reasonable -- then it could be checked for and used in both
"markdown" and "html" code -- how about formatAttachment()
? -- thanks!!
On Sun, May 6, 2018 at 9:48 AM, Nicolás Bevacqua notifications@github.com wrote:
It sounds like you want a different function that lets you add custom handling of links, that could be used internally to manage attachments, and exposed so that people can add their own kinds of special "attachment" links
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bevacqua/woofmark/issues/67#issuecomment-386880691, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ-3RvuW7a1zO1WK-09spwKGjCLj5ks5tvv81gaJpZM4TvkPO .
I'm loving the new
options.mergeHtmlAndAttachment
ability to intercept and custom-format attachments -- https://github.com/bevacqua/woofmark/blob/b58efb794f7610c92d70bec435cfd021ab45673c/src/html/linkOrImageOrAttachment.js#L51We have done so for a custom rendering of CSV files, for example, with the following code:
https://github.com/publiclab/PublicLab.Editor/blob/f5f5492e5188963b0d6b672fc60093cef34c065c/src/adapters/PublicLab.Woofmark.js#L144-L146
However, this only works in HTML mode, not markdown mode. So when dragging in an attachment in HTML mode, this custom formatter works great. But in markdown mode it is rendered as:
Do we need to port the
mergeHtmlAndAttachment
method implementation from/html/linkOrImageOrAttachment.js
over to/markdown/linkOrImageOrAttachment.js
to get this working in both modes?