diff -rupN /insert/includes/image.inc /insert/includes/image.inc
--- /insert/includes/image.inc	2011-04-29 17:36:34.000000000 +0200
+++ /insert/includes/image.inc	2011-11-14 14:03:10.000000000 +0100
@@ -39,7 +39,7 @@ function image_insert_styles() {
 /**
  * Implementation of hook_insert_content().
  */
-function image_insert_content($item, $style, $widget) {
+function image_insert_content($item, $style, $widget, $entity) {
   $style_name = preg_replace('/^image_/', '', $style['name']);
   return theme(array('image_insert_image__' . str_replace('-', '_', $style_name), 'image_insert_image'), array('item' => $item, 'widget' => $widget, 'style_name' => $style_name));
 }
diff -rupN /insert/includes/insert.inc /insert/includes/insert.inc
--- /insert/includes/insert.inc	2011-04-29 17:36:34.000000000 +0200
+++ /insert/includes/insert.inc	2011-12-01 19:36:15.000000000 +0100
@@ -19,7 +19,7 @@ function insert_insert_styles() {
 /**
  * Implementation of hook_insert_content().
  */
-function insert_insert_content($item, $style, $widget) {
+function insert_insert_content($item, $style, $widget, $entity) {
   $style_name = $style['name'];
 
   if (empty($item['fid'])) {
@@ -35,10 +35,10 @@ function insert_insert_content($item, $s
   }
 
   if ($style_name == 'image') {
-    return theme('insert_image', array('item' => $item, 'widget' => $widget));
+    return theme('insert_image', array('item' => $item, 'widget' => $widget, 'entity' => $entity));
   }
   else {
-    return theme('insert_link', array('item' => $item, 'widget' => $widget));
+    return theme('insert_link', array('item' => $item, 'widget' => $widget, 'entity' => $entity));
   }
 }
 
diff -rupN /insert/insert.module /insert/insert.module
--- /insert/insert.module	2011-04-29 17:36:34.000000000 +0200
+++ /insert/insert.module	2011-12-01 19:23:43.000000000 +0100
@@ -41,7 +41,7 @@ function insert_theme() {
 
     // Theme functions in includes/insert.inc.
     'insert_image' => array(
-      'variables' => array('item' => NULL, 'widget' => NULL),
+      'variables' => array('item' => NULL, 'widget' => NULL, 'entity' => NULL),
       'template' => 'templates/insert-image',
       'file' => 'includes/insert.inc',
     ),
@@ -145,14 +145,14 @@ function insert_widget_load($widget_type
 /**
  * Given an item and an insert style, return the output.
  */
-function insert_content($item, $style, $widget) {
-  return module_invoke($style['module'], 'insert_content', $item, $style, $widget);
+function insert_content($item, $style, $widget, $entity) {
+  return module_invoke($style['module'], 'insert_content', $item, $style, $widget, $entity);
 }
 
 /**
  * Process function for insert-enabled fields.
  */
-function insert_element_process($element) {
+function insert_element_process($element, &$form_state) {
   static $js_added;
 
   // Bail out early if the needed properties aren't available. This happens
@@ -163,6 +163,7 @@ function insert_element_process($element
 
   $item = $element['#value'];
   $field = field_info_field($element['#field_name']);
+  $item['field_name'] = $element['#field_name'];
   $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);
 
   $widget_settings = $instance['widget']['settings'];
@@ -173,6 +174,24 @@ function insert_element_process($element
     return $element;
   }
 
+  switch ($element['#entity_type']) {
+    case 'node':
+      $entity = entity_load($element['#entity_type']);
+      $entity = $entity[1];
+      $entity->entity_type = 'node';
+      break;
+    case 'comment':
+      $entity = entity_load($element['#entity_type']);
+      $entity = $entity[1];
+      $entity->entity_type = 'comment';
+      break;
+    case 'taxonomy_term':
+      $entity = entity_load($element['#entity_type']);
+      $entity = $entity[1];
+      $entity->entity_type = 'taxonomy_term';
+      break;
+  }
+
   // Add base settings only once.
   if (!isset($js_added)) {
     $js_added = array();
@@ -208,7 +227,7 @@ function insert_element_process($element
       if ($enabled && ($style = insert_style_load($style_name))) {
         $element['insert_templates'][$style_name] = array(
           '#type' => 'hidden',
-          '#value' => insert_content($item, $style, $instance['widget']),
+          '#value' => insert_content($item, $style, $instance['widget'], $entity),
           '#id' => $element['#id'] . '-insert-template-' . str_replace('_', '-', $style_name),
           '#name' => $element['#name'] . '[insert_template][' . $style_name . ']',
           '#attributes' => array('class' => array('insert-template')),
