使用 geshi 语法高亮显示 Lua 长字符串无法正确显示
我将新的 Lua 代码存储到使用 geshi 荧光笔(用 php 编写)的 Dokuwiki 系统中。例如,我在 lua 中遇到长字符串定义问题,
strLong = [[If this is a long string then I don't want it
highlighted as code else it looks very silly]]
可以使用 geshi lua.php 文件来纠正这个问题,我已经快速浏览了 http://qbnz.com/highlighter/geshi-doc.html 和多行注释工作正常,它只是多行字符串,而不是。
I am storing my new Lua code in to a Dokuwiki system which uses the geshi highlighter (written in php). How ever I am having a problem with long string definitions in lua for example
strLong = [[If this is a long string then I don't want it
highlighted as code else it looks very silly]]
It is possible to correct this using the geshi lua.php file, I have already taken a quick look at the documentation at http://qbnz.com/highlighter/geshi-doc.html and multiline comments are working fine it's just multiline strings which are not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢 geshi 用户列表中的 Benny Baumann
正确地对长字符串进行颜色编码
在lua.php中
在 $language_data = 数组 (
add
在样式表中
添加,当在 Lua 源上使用时,仅更改第二个注释类型,使其看起来像字符串。
With Thanks to Benny Baumann on the geshi-users list
To correctly colour code the long strings
In lua.php
In the $language_data = array (
add
In the style sheet add
to change only second comment type to look like a string, when used on a Lua source.