为 textarea Wicket 设置文本样式
我有一个由文本行组成的字符串。我想将这些行输入到具有一些 css 样式的文本区域中(例如更改某些行的颜色)。这怎么能做到呢?
I have got a string which consists of textlines. I would like to input these lines into a textarea with some css styles(eg changing the colour of some lines). How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TinyMCE
在编辑器中渲染 CSS 和其他标记方面确实做得相当不错。为了轻松地将其包含在 Wicket 中,我建议使用 org.wicketstuff.tinymce-parent 包。开发/源代码位于 GitHub 中,实际版本位于公共 Maven 存储库中。
然后,您可以使用标准 Wicket TextArea 组件并向其中添加 TinyMCE 行为,而不是直接使用 javascript。
一个缺点是,虽然 TinyMCE 非常成熟,但它也存在一些隐蔽的错误。如果可能的话,最好保持简单。
TinyMCE
does do a pretty decent job of rendering CSS and other markup in an editor.To include this easily with Wicket, I suggest the
org.wicketstuff.tinymce-parent
package. The development/source code is in GitHub and the actual releases are in the public maven repository.You can then use a standard Wicket TextArea component and add the TinyMCE behavior to it, instead of messing around with the javascript directly.
The one drawback is that, while TinyMCE is very mature, it also has some obscure bugs. It's best to keep it simple, if at all possible.
使用tinymce编辑器。 http://www.tinymce.com/
或者您可以使用任何类型的 Javascript WYSIWYG 编辑器
将tinymce 添加到页面,
use tinymce editor. http://www.tinymce.com/
or you can use any kind of a Javascript WYSIWYG Editor
Add tinymce to page,