Converting HTML from an email to Markdown?
Wondering if anyone has done this. The goal is to print the body of the email channel to our slack / mattermost.
I'm currently trying to convert turndown to a single file with webpack so our YouTrack Workflow can consume it, but no luck yet.
Please sign in to leave a comment.
Hello,
I'm Lena from the YouTrack Team.
Please try to use the `Prefer plain text for ticket descriptions` option in the mailbox integration → post-processing section.
https://www.jetbrains.com/help/youtrack/cloud/inbound-message-handling.html#email-channel-post-processing
I might actually turn on the text-only version just because it's simpler and it works 99% of the time, thank you so much for this great suggestion!
But I got it working after all anyway, so if anybody needs to include arbitrary JS modules in their YouTrack Workflows, this webpack config might be of help. So in this particular case, getting Turndown to work as a commonjs module:
Here's the webpack.config.js that takes the src/turndown.js file and its dependencies, bundles it into a js blob that can be pasted as a custom workflow:
Since some of the dependencies source contained reference to timers and a
process.browser
object which are not implemented for Workflows, these are omitted in the configuration file using webpack's plugin interface.A quirk of the result is that I had to include the file the following way:
Not sure what that is about, but it works.
Hi,
I'm happy to hear that the option works for you, and thank you for sharing your solution as well!