mirror of
https://github.com/progsource/maddy.git
synced 2026-03-24 23:40:39 +01:00
feat: add config options to en-/disable each parser
Also fix cmake line, so that ctest can find the test executable; update readme.
This commit is contained in:
10
README.md
10
README.md
@@ -2,8 +2,6 @@
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://semver.org/)
|
||||
[](https://travis-ci.org/progsource/maddy)
|
||||
[](https://ci.appveyor.com/project/progsource/maddy/branch/master)
|
||||
|
||||
maddy is a C++ Markdown to HTML **header-only** parser library.
|
||||
|
||||
@@ -45,13 +43,17 @@ std::stringstream markdownInput("");
|
||||
|
||||
// config is optional
|
||||
std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
|
||||
config->isEmphasizedParserEnabled = true; // default
|
||||
config->isHTMLWrappedInParagraph = true; // default
|
||||
// config->isEmphasizedParserEnabled = false; // default true - this flag is deprecated
|
||||
// config->isHTMLWrappedInParagraph = false; // default true - this flag is deprecated
|
||||
config->enabledParsers &= ~maddy::types::EMPHASIZED_PARSER;
|
||||
config->enabledParsers |= maddy::types::HTML_PARSER;
|
||||
|
||||
std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>(config);
|
||||
std::string htmlOutput = parser->Parse(markdownInput);
|
||||
```
|
||||
|
||||
You can find all parser flags in [`include/maddy/parserconfig.h`](include/maddy/parserconfig.h).
|
||||
|
||||
## How to run the tests
|
||||
|
||||
*(tested on Linux with
|
||||
|
||||
Reference in New Issue
Block a user