public static XDoc WebFormat(
            [DekiScriptParam("HTML source text or source uri (default: none)", true)] string source,
            [DekiScriptParam("caching duration in seconds (range: 60 - 86400; default: 300)", true)] double?ttl,
            [DekiScriptParam("return nil if source could not be loaded (default: text with error message)", true)] bool?nilIfMissing
            )
        {
            string text = WebText(source, null, null, true, ttl, nilIfMissing);

            if (text == null)
            {
                return(null);
            }
            return(SimpleHtmlFormatter.Format(text));
        }
Пример #2
0
 private void AssertHtml(string html, string input)
 {
     Assert.AreEqual(html.Replace("\r\n", "\n"), SimpleHtmlFormatter.Format(input).ToXHtml().Replace("\r\n", "\n"));
 }