Ejemplo n.º 1
0
        public static HtmlString RenderTex(this string textWithTex)
        {
            var    texReplacer = new TexReplacer(textWithTex);
            string html        = HttpUtility.HtmlEncode(texReplacer.ReplacedText);

            return(new HtmlString(texReplacer.PlaceTexInsertsBack(html)));
        }
Ejemplo n.º 2
0
Archivo: Md.cs Proyecto: hexandr/uLearn
		public static string RenderMd(this string md, string baseUrl = null)
		{
			var texReplacer = new TexReplacer(md);

			var markdown = new Markdown2(baseUrl)
			{
				NewWindowForExternalLinks = true,
				ExtraMode = true,
				SafeMode = false,
				MarkdownInHtml = false
			};

			var html = markdown.Transform(texReplacer.ReplacedText);
			return texReplacer.PlaceTexInsertsBack(html);
		}
Ejemplo n.º 3
0
        public static string RenderMd(this string md, string baseUrl = null)
        {
            var texReplacer = new TexReplacer(md);

            var markdown = new Markdown2(baseUrl)
            {
                NewWindowForExternalLinks = true,
                ExtraMode      = true,
                SafeMode       = false,
                MarkdownInHtml = false
            };

            var html = markdown.Transform(texReplacer.ReplacedText);

            return(texReplacer.PlaceTexInsertsBack(html));
        }
Ejemplo n.º 4
0
        public static string RenderMd(this string md, string baseUrlForRelativeLinks = null)
        {
            var texReplacer = new TexReplacer(md);

            var markdown = new Markdown
            {
                NewWindowForExternalLinks = true,
                ExtraMode       = true,
                SafeMode        = false,
                MarkdownInHtml  = false,
                UrlBaseLocation = baseUrlForRelativeLinks,
            };

            markdown.FormatCodeBlock += FormatCodePrettyPrint;

            var html = markdown.Transform(texReplacer.ReplacedText);

            return(texReplacer.PlaceTexInsertsBack(html));
        }
Ejemplo n.º 5
0
		public static HtmlString RenderTex(this string textWithTex)
		{
			var texReplacer = new TexReplacer(textWithTex);
			string html = HttpUtility.HtmlEncode(texReplacer.ReplacedText);
			return new HtmlString(texReplacer.PlaceTexInsertsBack(html));
		}