安全网页文本格式
我正在构建一个 Web 应用程序,需要允许用户将格式化文本保存到数据库中。 基本上他们只需要能够更改字体颜色、字体背景颜色、字体大小、粗体、斜体和下划线。
我想使用可以附加到文本区域的东西来显示格式栏。
最好使用除 HTML 之外的其他内容来标记格式,以便我可以在存储输入时对输入进行 HTML 编码,以确保安全。 当然,在渲染回浏览器时,它需要将自己的标记转换为 HTML。
有哪些选择?
I am building a web application that will need to allow users to save formatted text to a database. Basically they just need to be able to change font color, font background color, font size, bold, italics, and underline.
I would like to use something that I can just attach to a text area to make a formatting bar show up.
It would be nice to use something that marks up the formatting in something besides HTML so that I can HTML Encode the input when storing it, for safety. It would, of course, need to convert its own markup into HTML when rendering back to the browser.
What options are out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
FCKEditor 是最适合您的之一。 我们正在我们的 ASP.NET MVC Web 应用程序之一中使用它,它非常棒。
在选择FCKEditor之前,它尝试过其他网页编辑器,但配置它们的能力并不好。
检查 FCKEditor:http://www.fckeditor.net/
FCKEditor is one of the best fits for you. We are using it in one of our ASP.NET MVC web applications and it's awesome.
Before selecting FCKEditor, it tried other web editor but the ability to configure them was not good.
Check FCKEditor at: http://www.fckeditor.net/
我会看一下最新版本的 Ajax Control Toolkit 中的 HtmlEditor。 我还没有使用它 - 但免费,你无法击败它的价格。
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/ HTMLEditor/HTMLEditor.aspx
I'd take a look at the HtmlEditor in the latest version of the Ajax Control Toolkit. I haven't used it yet - but for free, you can't beat the price.
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/HTMLEditor/HTMLEditor.aspx
我可以向您推荐WymEditor。
它是 WYSIWYM(所见即所得)XHTML 编辑器(不是 WYSIWYG)。
它非常适合我的小型伪 CMS 模块,可以强制用户仅使用列表中的几个定义的样式,但我不知道它是否适合您的需求。
Plan B 是使用 TinyMCE,我比 FCKEdit 更喜欢它。
I can recommend you WymEditor.
It's WYSIWYM (What You See Is What You Mean) XHTML editor (not WYSIWYG).
It was perfect for my small pseudo-CMS module to force users to use only a few defined styles from a list, but I have no idea if it'll suit your needs.
Plan B is to use TinyMCE which I prefer more than FCKEdit.