using System; using System.Drawing; using System.Text; namespace Alsing.SourceCode.SyntaxDocumentExporters { public class SimpleHTMLExporter { private static StringBuilder sb; private static void write(string text, TextStyle s) { if (s != null) { if (s.Bold) Out(""); if (s.Italic) Out(""); if (s.Transparent) Out(""); else Out(""); } text = text.Replace("&", "&"); text = text.Replace("<", "<"); text = text.Replace(">", ">"); text = text.Replace(" ", " "); text = text.Replace("\t", " "); Out(text); if (s != null) { Out(""); if (s.Italic) Out(""); if (s.Bold) Out(""); } } private static string GetHTMLColor(Color c) { return string.Format("#{0}{1}{2}", c.R.ToString("x2"), c.G.ToString("x2"), c.B.ToString("x2")); } private static void Out(string text) { sb.Append(text); } public static string Export(SyntaxDocument doc, string CssClass) { sb = new StringBuilder(); doc.ParseAll(true); Out("