Using an open source C++ library for converting Markdown to HTML would be a more robust solution.  An example of a C++ library that could be used for this is maddy. maddy is an MIT licensed header-only library that only depends on the C++ 14 standard library.

The `markdownToHtml` function could be reimplemented using the maddy library as follows:

```
#include <memory>
#include <sstream>
#include <string>

#include "maddy/parser.h"

std::string markdownToHtml(std::string& markdown) {
    std::stringstream markdownStream(markdown);
    auto parser = std::make_unique<maddy::Parser>();
    return parser->Parse(markdownStream);
}
```

To compile this code you will also need to add the headers for the "maddy" library to the include path. Depending on the compiler, build system or IDE being used, the process to change the include path may vary.

As an alternative you could also a C library such as MD4C. MD4C is an MIT licensed Markdown parser written in C. It is compliant to the CommonMark specification.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence