Parse html string to Gumbo node tree, results must be destroyed. */
| 275 | |
| 276 | /** Parse html string to Gumbo node tree, results must be destroyed. */ |
| 277 | GumboOutput* parseFromString(const std::string &html) |
| 278 | { |
| 279 | const char *buf = html.data(); |
| 280 | size_t bufLen = html.length(); |
| 281 | // If you used contents.c_str(), it'd be harder to match up original |
| 282 | // positions, because c_str() creates a copy of the string and you can't do |
| 283 | // pointer arithmetic betweent contents.data() and the original_* pointers. |
| 284 | GumboOutput* output = gumbo_parse_with_options( |
| 285 | &kGumboDefaultOptions, buf, bufLen); |
| 286 | |
| 287 | return output; |
| 288 | } |
| 289 | |
| 290 | |
| 291 | GumboOutput* parseFromString(const QString &html) |
no test coverage detected