diff --git a/link_node.module b/link_node.module
index 563eabe..6e31074 100755
--- a/link_node.module
+++ b/link_node.module
@@ -88,28 +88,34 @@ function link_node_filter_link_node_process($text, $filter, $format, $langcode,
           }
 
           //drupal_set_message("found node $nid and it's of type $node->type");
+          $attributes = array();
 
           // iterate over all name=value pairs and override $node values with them
           if ( preg_match_all($meta_tag_params_regexp, $match[2][$key], $parm_match) == 0 ){
             $meta_tag_params_regexp=$meta_tag_params_regexp2 ;
           }
           if (preg_match_all($meta_tag_params_regexp, $match[2][$key], $parm_match)) {
-            $allowed_vars = explode(',', $filter->settings["filter_link_node_allowed_vars_$node->type"]);
+            $allowed_vars = explode(',', $filter->settings["filter_link_node_allowed_vars_$node->type"]);
+            
             for($i=0; $i<count($parm_match[1]); $i++) {
               $parm = $parm_match[1][$i];
               $val = $parm_match[2][$i];
-
+              
               // check the name ($parm) to make sure it's an allowable value (like "align" or "border" or something)
               if(in_array($parm, $allowed_vars)) {
-                $node->$parm = $val;
+                if ($parm == 'class') {
+                  $attributes[$parm] = explode(' ', $val);
+                }
+                else {
+                  $attributes[$parm] = $val;
+                }
               }
               else {
                 drupal_set_message("ignoring param '$parm' for ".$node->type." as it is not valid.  Possible values are '<code>". $filter->settings["filter_link_node_allowed_vars_$node->type"] ."</code>'.", 'warning');
               }
             }
           }
-
-          $matches_html[$key] = theme('link_node_thumbnail', array('node' => $node));
+          $matches_html[$key] = theme('link_node_thumbnail', array('node' => $node, 'attributes' => $attributes));
         }
         else {
           $output = theme("link_node_format", array('content' => t("Nonexistent node nid: ") . "$nid."));
@@ -144,8 +150,15 @@ function theme_link_node_thumbnail($variables) {
       return image_link_node_thumbnail($node);
     }
   }
+  
+  $attributes = $variables['attributes'];
+  if (!isset($attributes['class']) || !in_array('link-node', $attributes['class'])) {
+    $attributes['class'][] = 'link-node';
+  }
+  
+  $title = isset($attributes['title']) ? filter_xss($attributes['title'], array('span', 'p', 'strong', 'em', 'img')) : $node->title;
 
-  $output = l($node->title, "node/" . $node->nid, array('class' => 'link-node'));
+  $output = l($title, "node/" . $node->nid, array('attributes' => $attributes, 'html' => TRUE));
 
   return $output;
 }
