This is a migrated thread and some comments may be shown as answers.

HTMLFormatProvider... <font> tags do not load

3 Answers 218 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
zywave
Top achievements
Rank 1
zywave asked on 09 Aug 2010, 02:45 PM
Hello,

I am trying to get the RichTextBox to work with some of our existing HTML email context that we keep in our db.  While I can get very simple messages to load via the HTMLFormatProvider, I have noticed one glaring item.

When I try to load am html document that uses a '<font>' tag, any text inside the tag is not loaded/shown in the RichTextBox.  Its seems that similar tags like 'span' do work, but not 'font'.  Is this a known issue or is it supposed to behave like this?  Is there a complete list/example of what HTML tags will/will not work?

In the example below... 'Test Heading' will show, but 'Test paragraph' will not (unless I remove the '<font>' tags).  I've also tried it with font tags that have actual attributes and those too don't work (face, color, size, etc.).

Thanks.

private RadDocument CreateRadDocument(string content)
{
    HtmlFormatProvider provider = new HtmlFormatProvider();
    content = @"<html><body><h1>Test Heading</h1><p><font>Test paragraph.</font></p></body></html>";
    RadDocument document;
    using (MemoryStream stream = new MemoryStream())
    {
        StreamWriter writer = new StreamWriter(stream);
        writer.Write(content);
        writer.Flush();
        stream.Seek(0, SeekOrigin.Begin);
        document = provider.Import(stream);
    }
    return document;
}

3 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 10 Aug 2010, 05:07 PM
Hello zywave,

Support for <font> was indeed missing in Q2. However, fortunately we fixed it for Q2 SP1, which is coming later this week. Please let us know if you have any other questions.

Sincerely yours,
Ivailo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jeff
Top achievements
Rank 1
answered on 30 Oct 2010, 12:07 AM
I've installed 2010 Q2 SP1, but am still having a similar issue importing HTML.  Here's the code that is not working:

        RadDocument FromHtml(string html)
        {
            return new HtmlFormatProvider().Import(html);
        }

        public MainPage()
        {
            InitializeComponent();

            radRichTextBox.Document = FromHtml("This is normal text. <b>This is bold text.</b><br />This is a new line. <font face='Arial'>This is supposed to be Arial.</font>");
        }

The bold and line break formatting are handled fine, but the font face is always Times New Roman.  I've tried setting the text to different font faces, but with no luck.  From what I've read, HtmlFormatProvider should handle font tags on import.  Am I doing something wrong?
0
Ivailo Karamanolev
Telerik team
answered on 01 Nov 2010, 04:06 PM
Hello Jeff,

Indeed, there is a bug with the <font> support. The attributes color and size work as expected, however the face attribute is currently ignored. We have fixed this issue and the HtmlFormatProvider will have correct <font> support in the official Q3 release, which is coming very soon.
I have added Telerik points to your account in appreciation for the find. Let us know if you experience any other issues.

All the best,
Ivailo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
zywave
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or