How the Marked Pipeline works
masterMarked translates Markdown to HTML through a specific pipeline:
- Input: User provides a Markdown string.
- Lexer/Tokenizer: The
lexerfeeds segments of text intotokenizerfunctions. If a pattern matches, a token object is generated and organized into a nested tree structure. - walkTokens: The
walkTokensfunction traverses the token tree to perform final adjustments to token contents. - Parser/Renderer: The
parsertraverses the token tree and feeds each token into the appropriaterenderer. Therendererconverts the token into an HTML string. - Output: The concatenated outputs of the renderers form the final HTML result.