Flex富文本控件有什么实用价值吗?

发布于 2024-08-29 01:37:25 字数 143 浏览 10 评论 0原文

由于该控件发出奇怪的非标准 HTML,我想知道它是否有任何实用价值。

该控件发出 font 标签!

其他人是如何处理它的?您是否对文本进行某种正则表达式替换?

或者我错过了什么?

Since the control emits bizzare non-standard HTML, I'm wondering if it has any practical value.

The control emits font tags!

How are others dealing with it? Do you do some sort of RegEx replace on the text?

Or am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵性 2024-09-05 01:37:25

它有价值吗?是的。实用吗?这要看情况。为了从中获得有用的东西,你愿意做多少工作?

我必须使用 RTC 为基于 Jabber 构建的聊天应用程序创建聊天窗口。我最终不得不解析每条聊天消息的每一行,检查其文本宽度,GREP 出虚假的 HTML(TextFormat 和 Font 标签),同时保留样式标签(粗体、斜体等),然后将其转移到可以滚动的队列中随着新消息的发送和接收而向上。我必须在屏幕上保留 200 行的缓冲区(注意不要删除队列末尾的部分消息)。我还必须绘制表情符号 - :) ;) :-) 等的位置,找出它们的确切位置,然后将表情符号图像绘制到与聊天输出的位置完全匹配的同步滚动画布上窗户。所有这一切同时保持文本可选择并允许人们复制和粘贴它,并配有表情标记,在粘贴到输入字段时恢复为任何文本笑脸。

这是很多工作吗?你打赌是的。该产品最终有用吗?我喜欢这样认为。事实上,这非常酷。由于这是我参与的第一个 Flex 项目之一,它教会了我很多东西。

我是否希望 Adob​​e 支持真正的、无限制的 HTML?绝对地。

简短的回答:从 RTC 中获取一些东西是一件很麻烦的事情,但可能仍然比在 Java 或 C++ 中做任何类似有用的事情更快。 YMMV。

Does it have a value? Yes. Is it practical? That depends. How much work are you willing to do to get something useful out of it?

I had to use the RTC to create a chat window for a chat app that was built on Jabber. I wound up having to parse every line of every chat message, check its textwidth, GREP out the bogus HTML (TextFormat and Font tags) while leaving the styling tags (bold, italic, etc.) then shift it onto a queue that would scroll upwards as new messages were sent and received. I had to keep an onscreen buffer of 200 of these lines (taking care not to delete partial messages at the end of the queue). I also had to plot where the emoticons — :) ;) :-) and the like — were located, find out their exact locations, and then draw the emoticon images onto a sync-scrolled Canvas that exactly matched the position of the chat output window. All this while keeping the text selectable and letting people copy and paste it, complete with emoticon tokens that reverted to whatever text smiley upon pasting into the input field.

Was this a lot of work? You bet it was. Was the product ultimately useful? I like to think so. It was pretty cool, in fact. And as it was one of the first Flex projects I ever worked on, it taught me a lot.

Do I wish Adobe supported real, non-gimped HTML? Absolutely.

Short answer: Getting something out of the RTC is a bitch, but probably still faster than doing anything similarly useful in Java or C++. YMMV.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文