* Inline Lexer & Compiler
(links, options)
| 571 | */ |
| 572 | |
| 573 | function InlineLexer(links, options) { |
| 574 | this.options = options || marked.defaults; |
| 575 | this.links = links; |
| 576 | this.rules = inline.normal; |
| 577 | this.renderer = this.options.renderer || new Renderer(); |
| 578 | this.renderer.options = this.options; |
| 579 | |
| 580 | if (!this.links) { |
| 581 | throw new Error('Tokens array requires a `links` property.'); |
| 582 | } |
| 583 | |
| 584 | if (this.options.gfm) { |
| 585 | if (this.options.breaks) { |
| 586 | this.rules = inline.breaks; |
| 587 | } else { |
| 588 | this.rules = inline.gfm; |
| 589 | } |
| 590 | } else if (this.options.pedantic) { |
| 591 | this.rules = inline.pedantic; |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | /** |
| 596 | * Expose Inline Rules |
nothing calls this directly
no outgoing calls
no test coverage detected