解析HTML /显示RTF文本?文本、HTML、RTF

2023-09-06 15:51:04 作者:终遇你

我在寻找采取一些RTF code,如跌破此示例摘录,和显示在一个HTML页面。我并不需要它进行编辑,并且不希望它是在这个时候。在研究这个,我看到了很多的RTF功能的WYSIWYG编辑器,但是这不是真的我后。

I'm looking to take some RTF code, such as this sample excerpt below, and displaying it in an HTML page. I don't need it to be editable, and don't want it to be at this time. In researching this I've seen plenty of RTF-capable WYSIWYG editors, but that's not really what I'm after.

{}
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2
    {\fonttbl{\f0\fcharset0 Times New Roman;}
    {\f2\fcharset0 Segoe UI;}
    {\f3\fcharset0 Microsoft Yi Baiti;}
}
{\colortbl\red0\green0\blue0;\red255\green255\blue255;}
\loch\hich\dbch\pard\plain\ltrpar\itap0
{\lang1033\fs18\f2\cf0 \cf0\ql{\fs24\f2 
{\loch\f3\ltrch Hello }

有没有什么办法可以在HTML页面中显示RTF?它会更好,试图解析成HTML / CSS或者是,即使可能吗?我还审议了关于.NET端解析它,但都没有碰到过的解决方案。

Is there any way to display RTF in an HTML page? Would it be better to try and parse it into HTML/CSS or is that even possible? I also considered parsing it on the .NET side, but haven't came across any solutions.

任何有识之士将大大AP preciated!

Any insight would be greatly appreciated!

推荐答案

FWIW,我会去与这里找到了解决办法,因为它似乎是最灵活的。

FWIW, I'm going to go with the solution found here, as it seems the most flexible.

转换RTF和HTML