google/vim-syncopate — pull request #18 by chiphogg (2014-12-05 20:52:48+00:00)
Title: Stick a <div> inside the <body>

The point is to fix #16.

Broadly, the correct solution is "stick a `

` inside the body with the foreground/background from the `Normal` highlight group".

How to find out those colors? Well, `2html.vim` has a lot of logic to figure out what they are; it makes sense to just re-use that logic if we can. If `g:html_use_css == 0` (which we force to be true), then those colours occur in the `

` attribute. So we can solve this problem by just copying the `

` to a `

` and keeping the same attributes, right?

Well... almost. It turns out, Gmail disregards the deprecated `bgcolor=` and `text=` attributes. So we have to do a _little_ more legwork to turn them into a `style` attribute. But overall, this isn't too bad.