Esempio n. 1
0
        public static string AttributedStringToHtml(NSAttributedString attributedString)
        {
            var range      = new NSRange(0, attributedString.Length);
            var dictionary = new NSAttributedStringDocumentAttributes();

            dictionary.DocumentType = NSDocumentType.HTML;
            NSError error      = new NSError();
            var     data       = attributedString.GetDataFromRange(range, dictionary, ref error);
            var     htmlString = new NSString(data, NSStringEncoding.UTF8);
            var     cleanHtml  = CleanHtml(htmlString);

            return(cleanHtml);
        }