/**
         * Renders the widgets.
         *
         * @access private
         * @since  1.0
         *
         * @param array $args
         * @param array $instance
         */
        public function widget($args, $instance)
        {
            global $wp_query;
            $css_classes = '';
            $find = $replace = array();
            $post = get_post($wp_query->post->ID);
            $content = apply_filters('the_content', $post->post_content);
            /**
             * @var string $before_widget
             * @var string $after_widget
             * @var string $before_title
             * @var string $after_title
             */
            extract($args);
            $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
            $items = ezTOC::extract_headings($find, $replace, $content);
            if (FALSE !== strpos($title, '%PAGE_TITLE%') || FALSE !== strpos($title, '%PAGE_NAME%')) {
                $title = str_replace('%PAGE_TITLE%', get_the_title(), $title);
            }
            if (ezTOC_Option::get('show_hierarchy')) {
                $css_classes = ' counter-hierarchy';
            } else {
                $css_classes .= ' counter-flat';
            }
            switch (ezTOC_Option::get('counter')) {
                case 'numeric':
                    $css_classes .= ' counter-numeric';
                    break;
                case 'roman':
                    $css_classes .= ' counter-roman';
                    break;
                case 'decimal':
                    $css_classes .= ' counter-decimal';
                    break;
            }
            if ($instance['affix']) {
                $css_classes .= ' ez-toc-affix';
            }
            // bullets?
            //if ( ezTOC_Option::get( 'bullet_spacing' ) ) {
            //
            //	$css_classes = ' have_bullets';
            //
            //} else {
            //
            //	$css_classes = ' no_bullets';
            //}
            $css_classes = trim($css_classes);
            // an empty class="" is invalid markup!
            if (!$css_classes) {
                $css_classes = ' ';
            }
            if ($items) {
                echo $before_widget;
                echo '<div class="ez-toc-widget-container ' . $css_classes . '">' . PHP_EOL;
                do_action('ez_toc_before_widget');
                if (0 < strlen($title)) {
                    ?>

					<?php 
                    echo $before_title;
                    ?>

					<span class="ez-toc-title-container">

						<style type="text/css">
							#<?php 
                    echo $this->id;
                    ?>
 .ez-toc-widget-container ul.ez-toc-list li.active::before {
								background-color: <?php 
                    echo esc_attr($instance['highlight_color']);
                    ?>
;
							}
						</style>

						<span class="ez-toc-title"><?php 
                    echo $title;
                    ?>
</span>

						<span class="ez-toc-title-toggle">

							<?php 
                    if (ezTOC_Option::get('visibility')) {
                        echo '<a class="pull-right btn btn-xs btn-default ez-toc-toggle"><i class="glyphicon ez-toc-icon-toggle"></i></a>';
                    }
                    ?>

						</span>

					</span>

					<?php 
                    echo $after_title;
                    ?>

					<?php 
                }
                echo '<ul class="ez-toc-list">' . PHP_EOL . $items . '</ul>' . PHP_EOL;
                do_action('ez_toc_after_widget');
                echo '</div>' . PHP_EOL;
                echo $after_widget;
                // Enqueue the script.
                wp_enqueue_script('ez-toc-js');
            }
        }