HTMLFormatProvider... <font> tags do not load

4 posts, 0 answers
  1. zywave
    zywave avatar
    5 posts
    Member since:
    Feb 2008

    Posted 09 Aug 2010 Link to this post

    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;
    }
  2. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 10 Aug 2010 Link to this post

    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
  3. Jeff
    Jeff avatar
    2 posts
    Member since:
    May 2010

    Posted 29 Oct 2010 Link to this post

    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?
  4. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 01 Nov 2010 Link to this post

    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
Back to Top