Create() public static method

public static Create ( string markdown, string file, int lineNumber = 1 ) : SourceInfo
markdown string
file string
lineNumber int
return SourceInfo
Ejemplo n.º 1
0
        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));
        }
Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo n.º 4
0
        public virtual string Markup(string markdown, string file)
        {
            var normalized = Normalize(markdown);

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