Quote:
What we need to see is if gumbo-query can handle all of the css selectors available in css3.
|
Since it's about selecting elements rather than actually applying styles, it doesn't look like the likes of ::first-line and ::first-letter are supported. You'd have to remove those before passing it on.
https://github.com/lazytiger/gumbo-q....cpp#L382-L523
Btw, if you try something like this (p:first-child:first-of-type) it gives you a segmentation fault:
Code:
void test_html() {
std::string page = "<html><div class=\"chapter\"><p class=\"flush\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p><p>second child</p></div></html>";
CDocument doc;
doc.parse(page.c_str());
CNode pNode = doc.find(".chapter > p:first-child:first-of-type").nodeAt(0);
std::string content = page.substr(pNode.startPos(), pNode.endPos() - pNode.startPos());
printf("Node: #%s#\n", content.c_str());
}
(Silly example? Absolutely. But what else does one test for. ^_^)