diff --git a/js/codesnippet.js b/js/codesnippet.js
index 84557fb..cb33d32 100644
--- a/js/codesnippet.js
+++ b/js/codesnippet.js
@@ -9,6 +9,7 @@
   Drupal.behaviors.codesnippet = {
     attach: function (context, settings) {
       hljs.initHighlightingOnLoad();
+      $('.hljs').width(function(){ return $(this)[0].scrollWidth});
     }
   };
 
