alex Gorbatchev 的语法荧光笔给出错误消息

发布于 2024-12-15 08:08:31 字数 1823 浏览 0 评论 0原文

当我尝试实现 Gorbachev 的语法荧光笔时,我在 Chrome 和 Firefox 中收到以下错误消息。

本地主机的页面显示: 语法荧光笔 找不到刷子:php

更令人沮丧的是,因为我刚刚让它在同一文件夹中的测试页面上工作,它仍然有效。两个页面之间几乎没有什么不同。这是我的代码:

<??>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<!--STYLESHEET LINKS-->
<link  href="stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
<link  href="shThemeDefault.css" rel="stylesheet" type="text/css" media="screen" />
<link  href="shCore.css" rel="stylesheet" type="text/css" media="screen" />

<!--JQUERY SCRIPTS-->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>

<!--PROCESSING SCRIPTS
<script type="text/javascript" src="processing.js"></script>
<script type="text/javascript" src="init.js"></script>
-->
<!--syntax highlighter-->
<script type="text/javascript" src="shBrushPhp.js"></script>
<script type="text/javascript" src="shCore.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   // put all your jQuery goodness in here.
   SyntaxHighlighter.all();
 });
</script>
</head>


<title>code</title>

<body>
<div id="content">
<h2>code</h2>
<pre class="brush: php">
$last_modified = filemtime("header.php");
echo("last modified: ");
echo(date("m.j.y h:ia", $last_modified));
</pre>

<!--<script type="application/processing">
</script>
<canvas data-processing-sources="processing/lines.pde">
</canvas> -->
</div>
</body>
</html>
<??>

I'm getting the following error message in Chrome and firefox while trying to implement gorbachev's syntax highlighter.

The page at local host says:
SyntaxHighlighter
Can"t find brush for: php

It's all the more frustrating because i just got it working on a test page in the same folder, it still works. There is very little different between the two pages. Here's my code:

<??>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> 

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<!--STYLESHEET LINKS-->
<link  href="stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
<link  href="shThemeDefault.css" rel="stylesheet" type="text/css" media="screen" />
<link  href="shCore.css" rel="stylesheet" type="text/css" media="screen" />

<!--JQUERY SCRIPTS-->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>

<!--PROCESSING SCRIPTS
<script type="text/javascript" src="processing.js"></script>
<script type="text/javascript" src="init.js"></script>
-->
<!--syntax highlighter-->
<script type="text/javascript" src="shBrushPhp.js"></script>
<script type="text/javascript" src="shCore.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   // put all your jQuery goodness in here.
   SyntaxHighlighter.all();
 });
</script>
</head>


<title>code</title>

<body>
<div id="content">
<h2>code</h2>
<pre class="brush: php">
$last_modified = filemtime("header.php");
echo("last modified: ");
echo(date("m.j.y h:ia", $last_modified));
</pre>

<!--<script type="application/processing">
</script>
<canvas data-processing-sources="processing/lines.pde">
</canvas> -->
</div>
</body>
</html>
<??>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

相守太难 2024-12-22 08:08:31

对我来说,解决方案是使画笔样式不再大写。所以对我来说,我向语法荧光笔(haskell)添加了一个新的画笔,并且我更改了标记:

<pre class="brush:Haskell">...</pre>

或者

<pre class="brush:haskell">...</pre>

,您可以更改画笔标识符:

Brush.aliases   = ['Haskell'];

希望这有帮助!

For me, the solution was making the brush style non-capital. So for me, I was adding a new brush to syntaxhighlighter (haskell), and I changed the markup:

<pre class="brush:Haskell">...</pre>

To

<pre class="brush:haskell">...</pre>

Alternatively, you could change the brush identifier:

Brush.aliases   = ['Haskell'];

Hope this helps!

清晨说晚安 2024-12-22 08:08:31

它找不到 php 荧光笔的 js 文件。确保您上传了正确的画笔并拥有正确的画笔路径。我在让它在 MVC 3 应用程序中工作时遇到了很多麻烦。我最终使用了 Alex 拥有的 S3 托管文件。
尝试调用远程文件并查看它是否有效。还要从 jquery 调用中取出 SyntaxHighlighter.all() 调用。我的位于它自己的一组脚本标签中。看看是否有效。

  <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.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/shAutoloader.js" type="text/javascript"></script> 
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js" type="text/javascript"></script> 
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script>

It cant find the js file for the php highlighter. Make sure you uploaded the right brush and have the correct path for the brush. I had a lot of trouble getting it work in an MVC 3 application. I ended up using the S3 hosted files that Alex has.
Trying calling the remoted files and see if it works. Also take the call SyntaxHighlighter.all() out of your jquery call. Mine is in its own set of script tags. See if that works.

  <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.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/shAutoloader.js" type="text/javascript"></script> 
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js" type="text/javascript"></script> 
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script>
手心的温暖 2024-12-22 08:08:31

我刚刚将所有内容从页面移到测试页面中,重命名它,现在工作正常。我猜这只是其中之一。

i just moved all the content from the page into the test page, renamed it and it works fine now. just one of those things i guess.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文