任何好的JavaScript BBCode解析器? [英] Any good javascript BBCode parser?

查看:133
本文介绍了任何好的JavaScript BBCode解析器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在解析bbcode服务器端,但我想像这个网站一样显示预览。

Currently i'm parsing bbcode server side but i'd like to show a preview just like this site does.

如果我使用ajax处理bbcode服务器端有点滞后,所以我认为做客户端,只是显示预览。

If I process the bbcode serverside using ajax it's a bit laggy, so i thought doing it client side, to just show the preview.

你们知道用javascript写的任何bbcode解析器吗?

Do you guys know any bbcode parser written in javascript?

推荐答案

我没有亲自使用任何Javascript BBcode解析器,而是前两个Google结果( bbcodejs 这个博客文章)似乎很弱。前者似乎只支持简单的查找和替换,而后者似乎已预先设置了BBcode,所以如果你选择那个解决方案,你可能不得不破解它。

I haven't personally used any Javascript BBcode parsers, but the top two Google results (bbcodejs and this blog post) seem pretty weak. The former only seems to support simple find-and-replace, and the latter seems to have pre-set BBcode built in, so you'd probably have to hack it a bit if you chose that solution.

您最好的选择可能是推出自己的解决方案(可能会将您的工作从这里的两个链接中删除),或者只是使用AJAX并继续前进。这可能是确保预览准确无误的最佳方式,无论如何,预览并不一定要在每个按键上实时显示;甚至在发送请求之前的延迟是可以接受的。

Your best options are probably to roll your own solution (possibly basing your work off one of the two links here), or just use AJAX and move on. That's probably the best way to ensure that previews are accurate, and previewing doesn't have to be real-time on every keypress, anyway; a delay before even sending the request is acceptable.

这篇关于任何好的JavaScript BBCode解析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆