Пример #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();
            }
        }
        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();
            }
        }