Esempio n. 1
0
        /// <summary>
        /// Utility method for quickly formatting a text without having
        /// to create a TextileFormatter with an IOutputter.
        /// </summary>
        /// <param name="input">The string to format</param>
        /// <returns>The formatted version of the string</returns>
        public static string FormatString(string input)
        {
            StringBuilderOutputter output    = new StringBuilderOutputter();
            TextileFormatter       formatter = new TextileFormatter(output);

            formatter.Format(input);
            return(output.GetFormattedText());
        }
Esempio n. 2
0
 private void DoTextileToHtml()
 {
     m_textileFormatter.Format(m_textInput.Text);
     m_cachedHtml = m_textileOutput.GetFormattedText();
     if (m_bodyElement == null)
     {
         m_bodyElement = m_webBrowser.Document.GetElementById("body");
         if (m_bodyElement == null)
         {
             // the browser was not ready for us yet
             m_webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(m_webBrowser_DocumentCompleted);
         }
         else
         {
             m_bodyElement.InnerHtml = m_cachedHtml;
         }
     }
     else
     {
         m_bodyElement.InnerHtml = m_cachedHtml;
     }
 }