bureaucracy options set validate: 'image', failing non-image attachments
jywarren opened this issue · comments
Finally got this bug!
This needs to be set to upload.validate || 'image'
, to properly set validator as in README: https://github.com/bevacqua/woofmark#optionsattachments.
https://github.com/bevacqua/woofmark/blob/master/src/prompts/prompt.js#L116
I also found that after solving that, I got options.mergeHtmlAndAttachment is not a function
on this line:
That's because that should be specified here:
Line 74 in 2d93211
But that doesn't seem to appear anywhere else in the codebase. I think it could be from a previous version of the API, but it seems to be pretty simple:
options.mergeHtmlAndAttachment(chunks.before + chunks.selection + chunks.after, link);
And it expects:
chunks.before = parts.before;
chunks.selection = parts.selection;
chunks.after = parts.after;
I'm going to try just adding a default that wraps it in an <a>
tag.
Happy to submit a PR shortly.
There may be a more up-to-date way to do this, perhaps modeling on what happens in https://github.com/bevacqua/woofmark/blob/2d932112d44c7f72ccc9e23daf6749b9cc8bcdde/src/markdown/linkOrImageOrAttachment.js -- but it's a bit obscure to me, so I'll stick with a minimal change for now.
Fix submitted in #46!