コード例 #1
0
        public InlineLexer(IDictionary<string, LinkObj> links, Options options)
        {
            _options = options ?? new Options();

            this.links = links;
            this._rules = new NormalInlineRules();

            if (this.links == null)
            {
                throw new Exception("Tokens array requires a `links` property.");
            }

            if (_options.Gfm)
            {
                if (this._options.Breaks)
                {
                    _rules = new BreaksInlineRules();
                }
                else
                {
                    _rules = new GfmInlineRules();
                }
            }
            else if (this._options.Pedantic)
            {
                _rules = new PedanticInlineRules();
            }
        }
コード例 #2
0
        public Lexer(Options options)
        {
            _options = options ?? new Options();
            _rules = new NormalBlockRules();

            if (_options.Gfm)
            {
                if (_options.Tables)
                {
                    _rules = new TablesBlockRules();
                }
                else
                {
                    _rules = new GfmBlockRules();
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Static Lex Method
 /// </summary>
 public static TokensResult Lex(string src, Options options)
 {
     var lexer = new Lexer(options);
     return lexer.Lex(src);
 }
コード例 #4
0
 /// <summary>
 /// Static Parse Method
 /// </summary>
 public static string Parse(TokensResult src, Options options)
 {
     var parser = new Parser(options);
     return parser.Parse(src);
 }
コード例 #5
0
 public Parser(Options options)
 {
     this.tokens = new Stack<Token>();
     this.token = null;
     _options = options ?? new Options();
 }
コード例 #6
0
 public _Marked(Options options)
 {
     Options = options ?? new Options();
 }
コード例 #7
0
 public Renderer(Options options)
 {
     Options = options ?? new Options();
 }