Copy as HTML
for IntelliJ IDEA

Compatible with  IntelliJ IDEA
36 756
Copies a snippet of code as html
  • Adds menu items "Copy as HTML" to main menu and editor popup. Will copy the current selection or the complete editor buffer. Currently only works if focus is in editor (for example won't work in project tree).
  • Preserves more formatting than the built-in HTML export.
  • HTML is only a snippet (without html and body tags) meant to be inserted into a complete HTML document.
  • Currently HTML format is fixed and uses CSS a lot.
  • Options: unindent, add border, padding, line numbers, tabs to spaces conversion, include editor's warning and error highlighting (see IDE Settings -> Copy as HTML).
  • Reuses the editor "Show Line Numbers" setting (see Idea's "View" menu).

Download plugin

Recent change notes

Re-compiled for Java 6.
I'll suggest filling "Bugtracker page" for this plugin. As I understood for, the official bugtracker for this is
Not working under java 6: "Unsupported major.minor version 51.0"
Hi there, first of all: thank you for maintaining and getting this plugin back into the repository again. I was quite amazed to be notified about a new version on startup, since I was used to grab and install it manually for years now. However, there is a small to fix but huge in effect issue with 0.8: it was compiled with Java 1.7 target version. While we all know JDK 6 support has ended, there is quite a bunch of people who cannot switch for ther development environment. Especially all Mac users suffer from IDEA not running stable on JRE7, so we still have to use JRE6. That is why I had to switch back to 0.7.1 manually. It would be great if you could recompile a 0.8.1 version with JRE6 copatibility. Thanks in advance René
Doesn't work with Mac OS.
Does not work with phpStorm 5.
Please not that the fix posted at that kaimiddleton mentiones also fixes this for IntelliJ IDEA 11.x
Ok, there is a fix for Rubymine 4.0.2 documented here:
Download the .jar file and follow the five steps I describe.
Here is the exception reported by Rubymine 4.0.1:
Error during dispatching of java.awt.event.ItemEvent[ITEM_STATE_CHANGED,item=Copy as HTML,stateChange=DESELECTED] on chkmenuitem2: com.intellij.openapi.editor.Document.getMarkupModel(Lcom/intellij/openapi/project/Project;)Lcom/intellij/openapi/editor/markup/MarkupModel;
Doesn't work for Rubymine 4.0.1
FYI: A fixed version of the plug-in that works for IDEA 11 is attached to the WI-8163 YouTrack report neuro159 shows below. Thanks to Alexey Gopachenko from JetBrains for assisting Keith in fixing this.
Broken for IDEA 11 platform EAP, please update.
Are you going to upgrade it to 3.0?
Awesome plugin. Has a small bug though. When using the real line numbers, it increments by 1. So that what is on line 684, on paste is on 685.
Hey, youÂ’re the goto expret. Thanks for hanging out here.
Please  sign in  to leave a comment.