SyntaxHighlighter 不显示工具栏

发布于 2024-10-10 16:17:11 字数 833 浏览 4 评论 0原文

我在我的应用程序中使用最新的 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 技术交流群。

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

发布评论

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

评论(5

攒眉千度 2024-10-17 16:17:11

我一直在尝试自己解决这个问题。我不会在这里声称 100% 正确,但据我所知,这就是答案:

  1. 工具栏在从版本 2 到版本 3 的更新中发生了变化
  2. 。工具栏不再包含图标之类的东西。
  3. 默认工具栏现在是简单的“?”。

如果这是真的的话,这太糟糕了。带图标的弹出工具栏是让我选择 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:

  1. Toolbar was changed in update from version 2 to version 3.
  2. Toolbar no longer includes the icons and whatnot.
  3. The default toolbar is now the simple '?'.

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

笛声青案梦长安 2024-10-17 16:17:11

虽然我自己想要工具栏,但工具栏功能之一似乎是复制和复制。粘贴 - 已包含在内,无需工具栏项:

如果双击代码上的任意位置,整个代码视图将替换为预先选择的视图,用户可以通过简单的 Ctrl/Cmd-C 从中进行复制。单击其他任何位置将使视图返回到原始状态。
http://alexgorbatchev.com/SyntaxHighlighter/whatsnew.html#copytoclipboard

我仍然喜欢弹出功能,但按钮少是件好事,我猜?

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:

If you double click anywhere on the code, the entire code view is replaces with a pre-selected view from which users can copy with a simple Ctrl/Cmd-C. Clicking anywhere else returns the view to the original state.
http://alexgorbatchev.com/SyntaxHighlighter/whatsnew.html#copytoclipboard

I would still like the pop out feature, but less buttons is a good thing, I guess?

情归归情 2024-10-17 16:17:11

同样的问题在这里。 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

阪姬 2024-10-17 16:17:11

只需转到插件配置,将荧光笔版本设置为 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!

初见 2024-10-17 16:17:11

我确认在版本 3 中工具栏不显示。

I confirm that in Version 3 the toolbar does not show.

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