# Benchmark test file This file is for the benchmark testing. --- This specification defines which markdown syntax can be parsed by maddy. There is no HTML allowed in the markdown syntax - or said otherwise - it might destroy the output, if there was HTML in your markdown. The Parser expects you to use spaces and not tabs for indentation in the markdown. If a line starts with `<` and `config->enabledParsers |= maddy::types::HTML_PARSER;` is set, it expects that the upcoming line is HTML and therefor will not be surrounded by a paragraph. ## Headlines ``` # h1 heading ## h2 heading ### h3 heading #### h4 heading ##### h5 heading ###### h6 heading ``` results in: ```html

h1 heading

h2 heading

h3 heading

h4 heading

h5 heading
h6 heading
``` ## Links ``` [Text of the link](http://example.com) ``` results in ```html Text of the link ``` ``` [Text of the link](http://example.com "title text") ``` results in ```html Text of the link ``` ## Lists ### unordered Characters "*", "+" or "-" to make an unordered "bullet" list are equivalent. ``` - unordered * list + items ``` results in ```html ``` ``` * unordered * list * items * in + an - hierarchy ``` results in ```html ``` ### ordered ``` 1. ordered 2. list 3. items ``` results in ```html
  1. ordered
  2. list
  3. items
``` ``` 1. ordered * list * items ``` results in ```html
  1. ordered
  2. list
  3. items
``` ``` 1. ordered * list 1. items * in 1. an * hierarchy ``` results in ```html
  1. ordered
  2. list
    1. items
    2. in
      1. an
    3. hierarchy
``` ### combination ``` * combination * of 1. unordered and * ordered * list ``` results in ```html ``` ### checklist ``` - [ ] some item - [ ] another item - [x] some checked item ``` results in ```html ``` might not work in combination with other lists ## Code Blocks ``` some code ``` results in ```html

some code
``` ```cpp int a = 42; ``` results in ```html

int a = 42;
``` ## Inline code some text `some inline code` some other text results in ```html some text some inline code some other text ``` ## quotes ``` > Some quote ``` results in ```html

Some quote

``` ## bold ``` **bold text** __bold text__ ``` results in ```html bold text bold text ``` ## italic ``` *italic text* ``` results in ```html italic text ``` ## emphasized This can be disabled by setting `config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;`. ``` _emphasized text_ ``` results in ```html emphasized text ``` ## strikethrough ``` ~~striked through text~~ ``` results in ```html striked through text ``` ## horizontal line ``` --- ``` results in ```html
``` ## break line ``` New\r\nLine ``` results in ```html New
Line ``` ## Images ``` ![Image alt text](http://example.com/example.png) ``` results in ```html Image alt text ``` ## Tables ``` |table> Left header | middle header | last header - | - | - cell 1 | cell 2 | cell 3 cell 4 | cell 5 | cell 6 - | - | - foot a | foot b | foot c |
Left header middle header last header
cell 1 cell 2 cell 3
cell 4 cell 5 cell 6
foot a foot b foot c
``` table header and footer are optional ## LaTeX(MathJax) block support To turn on the LaTeX support - which basically is only a [MathJax](https://www.mathjax.org/) support and makes sure, that formulas aren't internally checked for other parsers - it has to be enabled in config: ```cpp std::shared_ptr config = std::make_shared(); config->enabledParsers |= maddy::types::LATEX_BLOCK_PARSER; std::shared_ptr parser = std::make_shared(config); std::string htmlOutput = parser->Parse(markdownInput); ``` After this you can do the following in Markdown: ``` $$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$ ``` Which results in ```html $$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$\n ```