Bootstrap

edit

Bootstrap styles the elements that have its classes. Bootstrap makes the renderer add them, so that the HTML of a document looks like the rest of a Bootstrap site:

ElementClasses
Tablestable
Imagesimg-fluid
Block quotesblockquote
Figuresfigure, and figure-caption on their captions
Alertsalert and the class of their kind, with role="alert" and mb-0 on their last paragraph
var options = new MarkdownParseOptions { Extensions = MarkdownExtensions.Bootstrap | MarkdownExtensions.PipeTables };
var tree = MarkdownSyntaxTree.ParseText("> Quote\n\n![Logo](logo.png)\n\n| Name |\n|------|\n| Apple |\n", options);

Assert.Equal("<blockquote class=\"blockquote\">\n<p>Quote</p>\n</blockquote>\n<p><img src=\"logo.png\" class=\"img-fluid\" alt=\"Logo\" /></p>\n<table class=\"table\">\n<thead>\n<tr>\n<th>Name</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Apple</td>\n</tr>\n</tbody>\n</table>\n", MarkdownHtmlRenderer.ToHtml(tree));

The classes come after the ones of the generic attributes. The syntax tree does not change.