Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ability to paste HTML and convert it to markdown on the fly #160
Although one of the things I like about MDE is the lack of bloat, I'll log this feature request anyway in case it's useful for one than one person.
Sometimes I created MD documents based on existing HTML content. Normally I copy and paste, then delete the tags and convert it to markdown (which is a total pain in the so-and-so when doing tables)
I was recently using Pandoc to convert HTML files into git-hub flavoured markdown, I wonder if this is something worth adding to MDE... if you detect HTML on the clipboard (it has it's own format) then you can run it through Pandoc before adding to the document and take away some of the pain.
If you aren't going to add a special action for this bound to a different hot key, then perhaps add an option. If the option isn't set (the default), then paste will act the same as always to avoid annoying existing users happy with the current implementation. If it is set, then it can prompt each time it detects CF_HTML on how you wish to proceed.
I suppose the problem with that is not all applications will be smart enough to use specific Clipboard formats and might just dump it in plain text regardless. In which case, perhaps a dedicated Paste HTML command might be a better option.
Or, maybe instead just a new document command, similar to Alt+F, but instead of formatting the document, it converts the selection. That way it doesn't matter how the content ended up in the document, no new option, no changed behaviours and no ambiguity.
Actually, I think my original idea of looking for CF_HTML isn't practical, as some applications use it to specify richer versions of plain text... e.g. our old friend Visual Studio. I noticed that when copying a plain C# snippet to the clipboard, it included both RTF and HTML in addition to the plain text formats. I can't imagine end users would be hugely happy if they pasted something they expected to be plain text and it suddenly turned into some HTML monstrosity.
In which case perhaps my final suggestion of adding some form of "HTML => Markdown" command to convert whatever text the user has currently selected is the optimal solution, and completely ignore clipboard formats.