如何使用Alex Gorbatchev编写的语法荧光笔的最新版本(3.0.83)?

时间:2015-03-29 12:10:45

标签: javascript html css syntaxhighlighter

我正在尝试使用语法高亮显示但它不起作用。 这是你好的世界样本。

<!doctype html>
<html>
    <head>
        <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
        <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
        <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
        <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
    </head>

    <body>
<pre class"brush:cpp;">
int main()
{
    std::cout << "Hello, world!";
    return 0;
}
</pre>
    <script type="text/javascript">
        //SyntaxHighlighter.config.bloggerMode = true;
        SyntaxHighlighter.all();
    </script>
</body>
</html>

语法没有突出显示。

1 个答案:

答案 0 :(得分:1)

你忘了课后的=

<!doctype html>
<html>
    <head>
        <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
        <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
        <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
        <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
    </head>

    <body>
<pre class="brush:cpp;">
int main()
{
    std::cout << "Hello, world!";
    return 0;
}
</pre>
    <script type="text/javascript">
        //SyntaxHighlighter.config.bloggerMode = true;
        SyntaxHighlighter.all();
    </script>
</body>
</html>