如何在 Drupal 6 编辑器中突出显示 PHP 代码?
我一直在寻找一个好的编辑器,具有语法突出显示功能,可以在 drupal 6 节点主体中使用 php 代码。
我想首先澄清一件事,我不需要在节点中“发布”或“显示”的代码使用语法高亮。但我需要为某些页面编写 php 代码并编写它们就像没有任何突出显示的文本一样,非常烦人。
正如你在下面看到的,我想要 php 语法 突出显示。
我尝试了多种组合,但没有找到我真正想要的任何东西。 以下是我尝试过的一些事情......
我尝试了 TinyMCE 和 codemagic、codemirror、editarea。但什么也没有 确实发挥了应有的作用。 除了上述内容之外,尝试在任何所见即所得编辑器中编写和保留代码确实是一件痛苦的事。
然后我尝试了 colorer 模块,但遇到了很多问题,但没有 即使是该模块的一个错误报告和问题也已修复。
那么有没有办法将 php 代码编写为代码而不是 drupal 节点内的文本..? 或者是没有人关心它,因为几乎没有人在节点内编写 php 代码..? 我希望不是唯一的一个,并且确实存在一些解决方案。
I have been looking for a good editor with syntax highlighting for php code to be used in the drupal 6 node body.
I would like to clear one thing first, I DO NOT need a syntax highligter for a code "posted" or "displayed" in the node. But I need to write php codes for some pages and writing them like a text without any highlighting, is pretty annoying.
As you can see below, I would like the php syntax <?php echo "Hello world"; ?>
to be highlighted.
I tried many combinations and not found anything that I really desire.
below are some things that I tried...
I tried TinyMCE with codemagic, codemirror, editarea. But nothing
really works as they should.
adding to the above, trying to write and preserve code in any wysiwyg editor is a real pain in the a**.Then I tried colorer module but am facing many problems and not
even a single bug report and issue of this module is fixed.
So isn't there a way to write php code as code and not as text inside the drupal nodes..??
Or is it that nobody bothered about it because anyone hardly writes php code inside nodes..?
I hope am not the only one and some solution to it does exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ACE 编辑器 作为
编辑:但是,它仅适用于 Drupal 7,这没有帮助......
The ACE editor works really well as a code editor for
<textarea>
s, and it has a Drupal module. ACE is well maintained, so I'd check them out as an alternative to colorer, TinyMCE, et al.Edit: However, it's only for Drupal 7, which won't help...