浏览器编辑器中的简单语法突出显示
我一直在考虑在编辑文本时突出显示文本中的各种文本。我玩过代码镜像,虽然它令人印象深刻,但为其创建另一种模式太难了。
理想情况下,我能够用正则表达式来指示我想要突出显示的内容。或者同样简单的事情。
作为一个例子,我想强调@username twitter 风格和#tag。在某些情况下,一行以 开始。
property::
值得强调一下。
为代码镜像创建一个非常愚蠢的解析器的简单方法将非常酷,这样对于比我更有 JS 天赋的人来说,高级选项就存在了。
我有一种可怕的感觉,这件事很难做到。
欢迎所有建议。
I've been looking at highlighting various bits of text in a text are as they are being edited. I've had a play with code mirror, whilst its seriously impressive its just too hard create another mode for it.
Ideally I'd be able to indicate what I want to highlight with a regular expression. Or something equally simple.
as an example I'd like to highlight @username twitter style and #tag as well. There are cases where a line starts with.
property:: value
that would be nice to emphasise too.
A simple way of creating a really dumb parser for code mirror would be very cool, that way the advanced option is there for someone with more JS talent than me.
I've got a horrible feeling that this is something that is just hard to do though.
All suggestions welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论