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

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

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

            string htmlLinebreaksText = ReplaceWithHtmlLinebreaks(text);

            return(htmlLinebreaksText);
        }
예제 #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);
        }
예제 #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);
        }