SyntaxHighlighter 不显示工具栏
我在我的应用程序中使用最新的 SyntaxHighlighter,由于某种原因,工具栏在 IE、Firefox 或 Chrome 中不显示。代码突出显示没有问题,但我想要工具栏。更糟糕的是,官方网站上的工具栏演示也无法使用。
我错过了一些明显的东西吗?以下是代码块。
<script src="Scripts/syntaxhighlighter/scripts/shBrushCSharp.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="Scripts/syntaxhighlighter/styles/shCoreDefault.css" />
<script type="text/javascript">
// Highlight code
SyntaxHighlighter.all();
</script>
<pre class="brush: csharp; ruler: true; title: 'Test'; toolbar: true;">
public static bool HelloWorld()
{
// Return
return false;
}
</pre>
I am using the latest SyntaxHighlighter within my app and for some reason the toolbars do not show in IE, Firefox or Chrome. The code highlights without issue, but I want to have toolbars. What makes things worse is that the toolbar demo on the official website is not working either.
Am I missing something obvious? Below are the code nuggets.
<script src="Scripts/syntaxhighlighter/scripts/shBrushCSharp.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="Scripts/syntaxhighlighter/styles/shCoreDefault.css" />
<script type="text/javascript">
// Highlight code
SyntaxHighlighter.all();
</script>
<pre class="brush: csharp; ruler: true; title: 'Test'; toolbar: true;">
public static bool HelloWorld()
{
// Return
return false;
}
</pre>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我一直在尝试自己解决这个问题。我不会在这里声称 100% 正确,但据我所知,这就是答案:
如果这是真的的话,这太糟糕了。带图标的弹出工具栏是让我选择 SH 而不是其他选项的原因之一。
这就是我将最新包中包含的 CSS 文件与启用了“正确”工具栏版本的网站上可用的 CSS 进行比较的猜测。
这是我窥探的一个链接:ramymostafa.com
I've been trying to figure this one out myself. I won't claim to be 100% correct here, but from what I can tell, this is the answer:
This pretty much sucks, if it's true. The pop-up toolbar w/ icons is one of the things that made me choose SH over the other options.
This is what I'm guessing comparing the included CSS files in the latest package to the CSS available on sites that have a version with the "proper" toolbar enabled.
Here's a link to one I was snooping in: ramymostafa.com
虽然我自己想要工具栏,但工具栏功能之一似乎是复制和复制。粘贴 - 已包含在内,无需工具栏项:
我仍然喜欢弹出功能,但按钮少是件好事,我猜?
While I would like the toolbar myself, it seems that one of the toolbars features - copy & paste - have been included without the need for a toolbar item:
I would still like the pop out feature, but less buttons is a good thing, I guess?
同样的问题在这里。 v3 好像没有工具栏。
我再次使用 v2:http://alexgorbatchev.com/SyntaxHighlighter/download/download。 php?sh_2.1.382
如果您复制 css 和 js,请不要忘记将图像包含在文件夹样式中
the same problem here. looks like there is no toolbar in v3.
i use v2 again: http://alexgorbatchev.com/SyntaxHighlighter/download/download.php?sh_2.1.382
if you copy the css and js around, don't forget to include the images in folder styles
只需转到插件配置,将荧光笔版本设置为 VERSION 2X,即可轻松显示工具栏。这样工具栏就会再次显示!
The toolbar can be easily be showing simply go to the plugin configuration, on the Highlighter Version set to VERSION 2X. This way the toolbar will be shown again!
我确认在版本 3 中工具栏不显示。
I confirm that in Version 3 the toolbar does not show.