Example #1
0
 static void ConvertAndWrite(TextReader reader)
 {
     using (TextWriter writer = TextToHtml.OpenWriterToFile(OUTPUT_TXT))
     {
         try
         {
             TextToHtml converter = new TextToHtml();
             string convertedString = converter.ReadAndConvert(reader);
             writer.Write(convertedString);
         }
         catch (Exception e)
         {
             Console.Error.WriteLine(e.Message);
         }
     }
 }
Example #2
0
 // converts text to html
 private string ConvertText(string text)
 {
     string convertedString = null;
     using (TextReader reader = TextToHtml.OpenReaderFromString(text))
     {
         TextToHtml converter = new TextToHtml();
         convertedString = converter.ReadAndConvert(reader);
     }
     return convertedString;
 }