MCPcopy Create free account
hub / github.com/Hashnode/starter-kit / InlineLexer

Function InlineLexer

packages/utils/renderer/marked.js:573–593  ·  view source on GitHub ↗

* Inline Lexer & Compiler

(links, options)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected