diff --git a/quicktabs.classes.inc b/quicktabs.classes.inc
index 56c2569..172286b 100644
--- a/quicktabs.classes.inc
+++ b/quicktabs.classes.inc
@@ -188,7 +188,10 @@ class QuickSet {
       $renderable_contents = 0;
       foreach ($this->contents as $key => $tab) {
         $contents = $tab->render(TRUE);
-        if (empty($contents)) {
+        reset($contents);
+        $string = strip_tags($contents[key($contents)]['#markup']);
+        $string = trim($string); // If string contain only white spaces it will be removed
+        if (!$string) {
           // Rather than removing the item, we set it to NULL. This way we retain
           // the same indices across tabs, so that permanent links to particular
           // tabs can be relied upon.
