HTML Labels

Aug 11, 2012 at 4:59 AM

Ran into an issue where HTML labels where not generating dot code correctly. For the HTML label to render its value is escaped with <>. For example, label=<<HTML></HTML>>. Currently it is surrounding this with quotes which causes it to render as text instead of html.

I submitted a patch with the fix I used locally. Atleast I think I did, mercurial is new to me :)

AttributedUtils.cs

        public static string GetAttributeAssignment(KeyValuePair<string, string> attribute)
        {
            // CW: This is to support HTML labels. The syntax is label=<<HTML... without quotes.
            if (attribute.Key.ToLower() == "label")
            {
                if (attribute.Value.Length > 1)
                {
                    if (attribute.Value.Substring(0, 2) == "<<")
                    {
                        return string.Format("{0}={1} ", attribute.Key, attribute.Value);
                    }
                }
            }
            return string.Format("{0}=\"{1}\" ", attribute.Key, attribute.Value);
        }
Coordinator
Aug 21, 2012 at 7:55 PM

Hi cwigley,

thanks for the patch. I did some small fixes and pushed it to the master. 

Steves