Beispiel #1
0
        public static string MakeTextFlat(string markdown, ConverterHooksConfig converterHooksConfig)
        {
            var text = MakeText(markdown, converterHooksConfig);

            string flattened = FlattenNewlinesRegex.Replace(text, " ");

            return(flattened);
        }
Beispiel #2
0
        public static string MakeTextHtmlLinebreaks(string markdown, ConverterHooksConfig converterHooksConfig)
        {
            var text = MakeText(markdown, converterHooksConfig);

            string htmlLinebreaksText = ReplaceWithHtmlLinebreaks(text);

            return(htmlLinebreaksText);
        }
Beispiel #3
0
        public static string MakeText(string markdown, ConverterHooksConfig converterHooksConfig)
        {
            var trimmedMarkdown = TrimServerSideMarkdown(markdown);

            var html = MakeHtml(trimmedMarkdown, converterHooksConfig);

            var stripped = GetDocumentText(html);

            return(stripped);
        }
Beispiel #4
0
        public static string MakeHtml(string markdown, ConverterHooksConfig converterHooksConfig)
        {
            if (markdown == null)
            {
                throw new ArgumentNullException("markdown");
            }
            if (converterHooksConfig == null)
            {
                throw new ArgumentNullException("converterHooksConfig");
            }

            string convertedMarkdown = converterHooksConfig.ApplyPreConversions(markdown);

            string html = MarkdownConverter.Transform(convertedMarkdown);

            string convertedHtml = converterHooksConfig.ApplyPostConversions(html);

            return(convertedHtml);
        }