internal static string ApplyBeforePostConversion(string input, MarkdownTransformContext context)
        {
            string appliedInput = MarkdownService.ApplyBeforePostConversion(input, context);
            appliedInput = ApplyRegexRules(appliedInput, BeforePostConversionRegexRules);

            return appliedInput;
        }
        internal static string ApplyAfterPostConversion(string input, MarkdownTransformContext context)
        {
            string decodedInput = MarkdownService.ApplyAfterPostConversion(input, context);

            decodedInput = ApplyRegexRules(decodedInput, AfterPostConversionRegexRules);

            string documentHtml = GetDocumentText(decodedInput);
            return documentHtml;
        }
        internal static string EncodeCodeMarkdown(string input, MarkdownTransformContext context)
        {
            string encodedFencedCodeMarkdown = EncodeFencedCodeMarkdownRegex.Replace(
                input,
                "<pre><code>$1</code></pre>");

            return Encode(
                encodedFencedCodeMarkdown,
                EncodeCodeMarkdownRegex,
                context.PreCodeBlocks,
                CodeBlockPlaceHolderFormat);

            //return Encode(input, EncodeCodeMarkdownRegex, context.PreCodeBlocks, CodeBlockPlaceHolderFormat);
        }
Example #4
0
        internal static string MakeHtmlInternal(
            string markdown,
            ConverterHooksConfig config,
            MarkdownTransformContext context)
        {
            if (markdown == null)
            {
                throw new ArgumentNullException("markdown");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            string lineBreakedMarkdown = LinebreaksRegex.Replace(markdown, LinebreaksReplace);

            string beforePreConversionsMarkdown = context.ApplyBeforePreConversions(lineBreakedMarkdown) ?? string.Empty;

            string preConversionMarkdown = config.ApplyPreConversions(beforePreConversionsMarkdown) ?? string.Empty;

            string afterPreConversionsMarkdown = context.ApplyAfterPreConversions(preConversionMarkdown) ?? string.Empty;

            string transformedHtml = MarkdownConverter.Transform(afterPreConversionsMarkdown) ?? string.Empty;

            string beforePostConversionHtml = context.ApplyBeforePostConversions(transformedHtml) ?? string.Empty;

            string postConversionHtml = config.ApplyPostConversions(beforePostConversionHtml) ?? string.Empty;

            string afterPostConversionHtml = context.ApplyAfterPostConversions(postConversionHtml) ?? string.Empty;

            string trimmedConversionHtml = afterPostConversionHtml.Trim();
            return trimmedConversionHtml;
        }
Example #5
0
        internal static string ApplyBeforePreConversion(string input, MarkdownTransformContext context)
        {
            string encodedCodeMarkdown = MarkdownEncodingHelper.EncodeCodeMarkdown(input, context);

            return encodedCodeMarkdown;
        }
Example #6
0
        internal static string ApplyBeforePostConversion(string input, MarkdownTransformContext context)
        {
            string encodedInput = MarkdownEncodingHelper.EncodeCodeBlocks(input, context);

            return encodedInput;
        }
Example #7
0
        internal static string ApplyAfterPreConversion(string input, MarkdownTransformContext context)
        {
            string encodedInput = MarkdownEncodingHelper.DecodeCodeMarkdown(input, context);

            return encodedInput;
        }
 internal static string EncodeCodeBlocks(string input, MarkdownTransformContext context)
 {
     return Encode(input, EncodeCodeBlocksRegex, context.PostCodeBlocks, CodeBlockPlaceHolderFormat);
 }
 internal static string DecodeCodeMarkdown(string input, MarkdownTransformContext context)
 {
     return Decode(input, DecodeCodeRegex, context.PreCodeBlocks);
 }
        internal static string ApplyBeforePreConversion(string input, MarkdownTransformContext context)
        {
            string encodedInput = MarkdownService.ApplyBeforePreConversion(input, context);

            return encodedInput;
        }