Source from the CopyAsHtml plugins for Intellij.