Esempio n. 1
0
 internal string InternalMarkup(string src, IMarkdownContext context)
 {
     int lineNumber = 1;
     var normalized = Normalize(src);
     string file = context.GetFilePathStack().Peek();
     if (context.GetIsInclude())
     {
         var match = DfmYamlHeaderBlockRule.YamlHeaderRegex.Match(normalized);
         if (match.Length > 0)
         {
             lineNumber += normalized.Take(match.Length).Count(ch => ch == '\n');
             Logger.LogInfo("Remove yaml header for include file.", file: file);
             normalized = normalized.Substring(match.Length);
         }
     }
     return Mark(
         SourceInfo.Create(normalized, file, lineNumber),
         context
     ).ToString();
 }
Esempio n. 2
0
        internal string InternalMarkup(string src, IMarkdownContext context)
        {
            int    lineNumber = 1;
            var    normalized = Normalize(src);
            string file       = context.GetFilePathStack().Peek();

            if (context.GetIsInclude())
            {
                var match = DfmYamlHeaderBlockRule.YamlHeaderRegex.Match(normalized);
                if (match.Length > 0)
                {
                    lineNumber += normalized.Take(match.Length).Count(ch => ch == '\n');
                    Logger.LogInfo("Remove yaml header for include file.", file: file);
                    normalized = normalized.Substring(match.Length);
                }
            }
            return(Mark(
                       SourceInfo.Create(normalized, file, lineNumber),
                       context
                       ).ToString());
        }