Create() public static method

public static Create ( string markdown, string file, int lineNumber = 1 ) : SourceInfo
markdown string
file string
lineNumber int
return SourceInfo
        public SourceInfo Consume(int charCount)
        {
            var    offset   = CalcLineNumber();
            string markdown = _markdown.Substring(_startIndex, charCount);

            _startIndex     += charCount;
            _currentMarkdown = null;
            return(SourceInfo.Create(markdown, _file, _lineNumber + offset));
        }
Esempio n. 2
0
        public SourceInfo Consume(int charCount)
        {
            string markdown = _markdown.Substring(_startIndex, charCount);
            var    result   = SourceInfo.Create(markdown, _file, LineNumber, CalcLineNumber(charCount) - CalcLineNumber() + 1);

            _startIndex     += charCount;
            _currentMarkdown = null;
            return(result);
        }
Esempio n. 3
0
        public SourceInfo Consume(int charCount)
        {
            var    offset = CalcLineNumber();
            string markdown;

            if (CurrentMarkdown.Length == charCount)
            {
                markdown        = CurrentMarkdown;
                CurrentMarkdown = string.Empty;
            }
            else
            {
                markdown        = CurrentMarkdown.Remove(charCount);
                CurrentMarkdown = CurrentMarkdown.Substring(charCount);
            }
            return(SourceInfo.Create(markdown, _file, _lineNumber + offset));
        }
Esempio n. 4
0
        public virtual string Markup(string markdown, string file)
        {
            var normalized = Normalize(markdown);

            return(Mark(SourceInfo.Create(normalized, file), null).ToString());
        }
 public SourceInfo ToSourceInfo()
 {
     return(SourceInfo.Create(CurrentMarkdown, _file, _lineNumber, _lineIndexer.Count - CalcLineNumber()));
 }
Esempio n. 6
0
 public SourceInfo ToSourceInfo()
 {
     return(SourceInfo.Create(CurrentMarkdown, _file, _lineNumber));
 }