start highlighting all the code blocks

@returns void
547472
function _highlight(node, onComplete) {

        // the first argument can be an Event or a DOM Element
        // I was originally checking instanceof Event but that makes it break
        // when using mootools
        //
        // @see https://github.com/ccampbell/rainbow/issues/32
        //
        node = node && typeof node.getElementsByTagName == 'function' ? node : document;

        var pre_blocks = node.getElementsByTagName('pre'),
            code_blocks = node.getElementsByTagName('code'),
            i,
            final_pre_blocks = [],
            final_code_blocks = [];

        // first loop through all pre blocks to find which ones to highlight
        // also strip whitespace
        for (i = 0; i < pre_blocks.length; ++i) {

            // strip whitespace around code tags when they are inside of a pre tag
            // this makes the themes look better because you can't accidentally
            // add extra linebreaks at the start and end
            //
            // when the pre tag contains a code tag then strip any extra whitespace
            // for example
            // <pre>
            //      <code>var foo = true;</code>
            // </pre>
            //
            // will become
            // <pre><code>var foo = true;</code></pre>
            //
            // if you want to preserve whitespace you can use a pre tag on its own
            // without a code tag inside of it
            if (pre_blocks[i].getElementsByTagName('code').length) {
                pre_blocks[i].innerHTML = pre_blocks[i].innerHTML.replace(/^\s+/, '').replace(/\s+$/, '');
                continue;
            }

            // if the pre block has no code blocks then we are going to want to
            // process it directly
            final_pre_blocks.push(pre_blocks[i]);
        }

        // @see http://stackoverflow.com/questions/2735067/how-to-convert-a-dom-node-list-to-an-array-in-javascript
        // we are going to process all <code> blocks
        for (i = 0; i < code_blocks.length; ++i) {
            final_code_blocks.push(code_blocks[i]);
        }

        _highlightCodeBlock(final_code_blocks.concat(final_pre_blocks), 0, onComplete);
    }
340146
public function compile()
	{
		$this->writeToTemplate(array('code' => ($this->htmlspecialchars) ? StringUtil::specialchars($this->data->text) : $this->data->text, 'highlight' => ($this->canChangeHighlight) ? $this->data->highlight : $this->highlight));
	}
1093721
protected function highlightCodeBlock($codeblock)
	{
		if(($tag=$this->getHighlightTag($codeblock))!==null && ($highlighter=$this->createHighLighter($tag)))
		{
			$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
			$tagLen = strpos($codeblock, $tag)+strlen($tag);
			$codeblock = ltrim(substr($codeblock, $tagLen));
			$output=preg_replace('/<span\s+[^>]*>(\s*)<\/span>/', '\1', $highlighter->highlight($codeblock));
			return "<div class=\"{$this->highlightCssClass}\">".$output."</div>";
		}
		else
			return "<pre>".CHtml::encode($codeblock)."</pre>";
	}
204336
public function start_html() {
        if ($this->bar) {
            throw new \coding_exception('Already started');
        }
        $this->bar = new \progress_bar();
        $this->bar->create();
        echo \html_writer::start_div('wibbler');
    }
718896
public function colorCheckCommand(): void
    {
        // $char= '❤';
        // $ret = ProcessUtil::run('echo ❤');
        // var_dump($ret, trim($ret[1]), $char === trim($ret[1]));
        //
        // die;

        $this->output->aList([
            'basic color output?' => Cli::isSupportColor() ? '<info>Y</info>' : 'N',
            'ansi char output?'   => Cli::isAnsiSupport() ? 'Y' : 'N',
            '256 color output?'   => Cli::isSupport256Color() ? 'Y' : 'N',
            'font symbol output?' => Cli::isSupport256Color() ? 'Y' : 'N',
        ], 'color support check');
    }
667620
public function start()
    {
        $whoops  = new Run();
        $handler = new PrettyPageHandler();

        $handler->addResourcePath(__DIR__.'/Resources');
        $handler->setEditor('sublime');

        $whoops->pushHandler($handler);
        $whoops->register();

        $this->whoops = $whoops;
    }
338327
private static function initStyles() {
            if (empty(self::$styles)) {
                foreach (self::$styleColours as $colourCode => $class) {
                    self::$styles[$colourCode] = new $class();

                    foreach (self::$styleVariants as $varCode => $var) {
                        self::$styles[$colourCode . $varCode] = new $class($var);
                    }
                }
            }
        }
1281790
function() {

      this.input = this.$("#new-todo");
      this.allCheckbox = this.$("#toggle-all")[0];

      this.listenTo(Todos, 'add', this.addOne);
      this.listenTo(Todos, 'reset', this.addAll);
      this.listenTo(Todos, 'all', this.render);

      this.footer = this.$('footer');
      this.main = $('#main');

      Todos.fetch();
    }
963130
void startBlock( String[] selectors , StringBuilder output  ) {
        this.results.add( new CssRuleOutput( selectors, output, isReference ) );
    }
555417
function highlight() {
    $('pre code').each(function (i, block) {
      hljs.highlightBlock(block);
    });
    $('pre code[highlight-lines]').each(function (i, block) {
      if (block.innerHTML === "") return;
      var lines = block.innerHTML.split('\n');

      queryString = block.getAttribute('highlight-lines');
      if (!queryString) return;

      var ranges = queryString.split(',');
      for (var j = 0, range; range = ranges[j++];) {
        var found = range.match(/^(\d+)\-(\d+)?$/);
        if (found) {
          // consider region as `{startlinenumber}-{endlinenumber}`, in which {endlinenumber} is optional
          var start = +found[1];
          var end = +found[2];
          if (isNaN(end) || end > lines.length) {
            end = lines.length;
          }
        } else {
          // consider region as a sigine line number
          if (isNaN(range)) continue;
          var start = +range;
          var end = start;
        }
        if (start <= 0 || end <= 0 || start > end || start > lines.length) {
          // skip current region if invalid
          continue;
        }
        lines[start - 1] = '<span class="line-highlight">' + lines[start - 1];
        lines[end - 1] = lines[end - 1] + '</span>';
      }

      block.innerHTML = lines.join('\n');
    });
  }
1045360
public function init()
    {
        $this->tags[self::NORMAL] = Color::make('normal');
        $this->tags[self::FAINTLY] = Color::make('normal', '', ['italic']);
        $this->tags[self::BOLD] = Color::make('', '', ['bold']);
        $this->tags[self::INFO] = Color::make('green');
        $this->tags[self::NOTE] = Color::make('green', '', ['bold']);
        $this->tags[self::PRIMARY] = Color::make('blue');
        $this->tags[self::SUCCESS] = Color::make('green', '', ['bold']);
        $this->tags[self::NOTICE] = Color::make('', '', ['bold', 'underscore']);
        $this->tags[self::WARNING] = Color::make('yellow');
        $this->tags[self::COMMENT] = Color::make('yellow');
        $this->tags[self::QUESTION] = Color::make('black', 'cyan');
        $this->tags[self::DANGER] = Color::make('red');
        $this->tags[self::ERROR] = Color::make('black', 'red');
        $this->tags[self::UNDERLINE] = Color::make('normal', '', ['underscore']);
        $this->tags[self::BLUE] = Color::make('blue');
        $this->tags[self::CYAN] = Color::make('cyan');
        $this->tags[self::MAGENTA] = Color::make('magenta');
        $this->tags[self::RED] = Color::make('red');
        $this->tags[self::YELLOW] = Color::make('yellow');
    }
1315590
public function start()
    {
        $finder  = new Finder;
        $appPath = realpath(getenv('APPPATH'));
        $appDir  = basename($appPath);
        $found   = [];

        $finder->ignoreUnreadableDirs()->files()->name('*.php')->in($appPath);

        $this->writeln([sprintf('In: ./%s/',$appDir), str_repeat('-', 60)]);

        foreach ($finder as $file)
        {
            $_file = new \SplFileObject($file->getRealPath());

            foreach ($_file as $k => $line) {
                $exp = preg_match('/TODO|FIXME/', $line);

                if ($exp > 0) {
                    $line = str_replace(['//','#','TODO:','FIXME:'], ['','','[TODO]','[FIXME]'], trim($line));
                    $found[$file->getRelativePath().'/'. basename($file)][] = "[{$k}]{$line}";
                }
            }
        }
        
        if (empty($found))
        {
            $this->text('There are not notes marked.');
            $this->newLine();
        }
        else
        {
            foreach ($found as $file => $lines)
            {
                $this->text(sprintf('./%s/%s:', $appDir, $file));
                $this->newLine();
                $this->listing($lines);
            }
        }
    }
738817
def highlightBlock(self, block):
        

        self.highlight_text(block, 0, len(block))
        self.setCurrentBlockState(0)

        state = 1
        for rule in self.rules:
            if re.match("comment\.block\.[\w\.]*start", rule.name):
                format = self.formats.get_format(rule.name) or self.formats.get_format("default")
                if self.highlight_multiline_block(block, rule.pattern,
                                                  foundations.common.get_first_item([item for item in self.rules
                                                                                     if item.name == rule.name.replace(
                                                              "start", "end")]).pattern, state, format):
                    break
                state += 1
1366751
function() {
    this.setColour(Blockly.Blocks.texts.HUE);
    this.appendDummyInput()
        .appendField(Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN);
    this.appendStatementInput('STACK');
    this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP);
    this.contextMenu = false;
  }
893202
public function highlightCommand($in): void
    {
        // $file = $this->app->getRootPath() . '/examples/routes.php';
        $file = $this->app->getRootPath() . '/src/Utils/Show.php';
        $src  = \file_get_contents($file);

        $code = Highlighter::create()->highlight($src, $in->getBoolOpt('ln'));

        $this->output->writeRaw($code);
    }
286204
public function draw(): void
	{
		// Don't draw progess bar if there are 0 items

		if($this->items === 0)
		{
			return;
		}

		// Calculate percent

		$percent = (float) min(($this->progress / $this->items), 1);

		// Build progress bar

		$progressBar = $this->buildProgressBar($percent);

		// Draw progressbar

		$this->output->write("\r" . $this->prefix . $progressBar);

		// If we're done then we'll add a newline to the output

		if($this->progress === $this->items)
		{
			$this->output->write(PHP_EOL);
		}
	}
1008802
public function start() {

        if($this->findElement()) {
            // Find all the objects!
            while(!$this->arrayEnd) {
                if(!$this->eatWhitespace()) break;
                if($this->readObject()){
                    yield $this->packageJSON();
                    $this->sanitize();
                }
            }
        }

    }