Displays a SyntaxHighlighter content.

@param string $tag The tag.
@param string $language The language.
@param string $content The content.
@return string Returns the SyntaxHightlighter content.
975727
protected function syntaxHighlighterContent($tag, $language, $content) {

        $attributes = [];

        $attributes["class"][] = "brush:";
        $attributes["class"][] = $language;

        return static::coreHTMLElement($tag, implode("", ["\n", htmlentities($content), "\n"]), $attributes);
    }
1161809
public function _present($tag,$content) {
        $name       =   $tag['name'];
        $name       =   $this->autoBuildVar($name);
        $parseStr   =   '<?php if(isset('.$name.')): ?>'.$content.'<?php endif; ?>';
        return $parseStr;
    }
186802
static public function fetchTagByUrl( $url, $language = false )
    {
        if ( $language )
        {
            if ( !is_array( $language ) )
                $language = array( $language );
            eZContentLanguage::setPrioritizedLanguages( $language );
        }

        $result = eZTagsObject::fetchByUrl( $url );

        if ( $language )
            eZContentLanguage::clearPrioritizedLanguages();

        if ( $result instanceof eZTagsObject )
            return array( 'result' => $result );

        return array( 'result' => false );
    }
1004019
protected function getSgrStyleSequence(string $tag): string
	{
		$styles = implode(';', $this->getStyleCodes($tag));

		return sprintf("\033[%sm", $styles);
	}
1180348
public static function escapeAndMarkdownLight(?string $content): string
    {
        return $content ? C::getMarkdown()->textLight(Html::escape($content)) : (string) $content;
    }
329187
public static String translate(String tag)
    {
        String cn = translator.get(tag);
        if (cn == null) return tag;
        return cn;
    }
861142
public function highlight($content)
	{
		$this->registerClientScript();

		$options['use_language']=true;
		$options['tabsize']=$this->tabSize;
		if($this->showLineNumbers)
			$options['numbers']=($this->lineNumberStyle==='list')?HL_NUMBERS_LI:HL_NUMBERS_TABLE;

		$highlighter=empty($this->language)?false:Text_Highlighter::factory($this->language);
		if($highlighter===false)
			$o='<pre>'.CHtml::encode($content).'</pre>';
		else
		{
			$highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options));
			$o=preg_replace('/<span\s+[^>]*>(\s*)<\/span>/','\1',$highlighter->highlight($content));
		}

		return CHtml::tag('div',$this->containerOptions,$o);
	}
1133539
protected static MetaLocale parse(String tag) {
    if (tag.indexOf('_') != -1) {
      tag = tag.replace('_', SEP);
    }
    Maybe<Pair<MetaLocale, CharSequence>> result = P_LANGUAGE_TAG.parse(tag);
    // This parser is for internal use only during code generation, so we blow up
    // severely if a language tag fails to parse..
    if (result.isNothing()) {
      throw new IllegalArgumentException("Failed to parse language tag: '" + tag + "'");
    }
    return result.get()._1;
  }
566404
public static String openTagClassHtmlContent(String tag, String clazz, String... content) {
		return openTagHtmlContent(tag, clazz, null, content);
	}
688913
protected function replaceColor($text, $tag, $match, $style): string
    {
        $replace = self::$noColor ? $match : sprintf("\033[%sm%s\033[0m", $style, $match);

        return \str_replace("<$tag>$match</$tag>", $replace, $text);
        // return sprintf("\033[%sm%s\033[%sm", implode(';', $setCodes), $text, implode(';', $unsetCodes));
    }
1157820
public function render(array $tag, $content) {
        $setup = $this->getFilter()->getTag($tag['tag']);

        $vars = $tag['attributes'];
        $vars['filter'] = $this->getFilter();
        $vars['content'] = $content;

        $this->_view->set($vars);

        // Try outside of the plugin first in-case they use their own templates
        try {
            $response = $this->_view->render($setup['template']);

        // Else fallback to the plugin templates
        } catch (Exception $e) {
            $this->_view->plugin = 'Utility';

            $response = $this->_view->render($setup['template']);
        }

        $this->_view->hasRendered = false;
        $this->_view->plugin = null;

        return $response;
    }
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>";
	}
861072
public static function parse(Tag &$Tag)
    {
        if (!empty($Tag->content) && $Tag->hasOption('translate') && is_callable(Config::get('translator'))) {
            $Tag->content = call_user_func_array(
                Config::get('translator'),
                array(
                    $Tag->content,
                    Config::get('textdomain')
                )
            );
        }
        
        if ($Tag->hasOption('bbContent')) {
            self::bb($Tag->content);
        }

        if ($Tag->hasOption('markdown')) {
            $Tag->addOption('cleanContent');
            self::markdown($Tag->content);
        }

        if ($Tag->hasOption('compress')) {
            self::compress($Tag);
        }

        return $Tag->content;
    }
347715
def highlight_syntax(src, lang, linenums=False):
    
    src = src.strip('\n')
    if not lang:
        lexer = TextLexer()
    else:
        try:
            lexer = get_lexer_by_name(lang, stripall=True)
        except ValueError:
            lexer = TextLexer()
    formatter = HtmlFormatter(linenos=linenums, tab_length=TAB_LENGTH)
    html = highlight(src, lexer, formatter)

    if lang:
        open_code = OPEN_CODE % (LANG_TAG % (lang, ), )
    else:
        open_code = OPEN_CODE % u''
    html = html.replace('<div class="highlight"><pre>', open_code, 1)
    html = html.replace('</pre></div>', CLOSE_CODE)
    return html
1270199
protected function preRender(RequireTagInterface $tag)
    {
        if ($this->isNonExistentOptionalTag($tag)) {
            return '';
        }

        $output = $this->doRender($tag, $tag->getPath());
        $output .= $this->preRenderLocalized($tag);

        return $output;
    }
875537
public CLDR.Locale resolve(String languageTag) {
    MetaLocale meta = MetaLocale.fromLanguageTag(languageTag);
    return resolve(meta);
  }
1298662
def setLanguage(self, language):
        
        cls = XCodeHighlighter.byName(language)
        if cls:
            self._highlighter = cls(self.document())