Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nth-child(odd) skips first node #32

Open
sir4ju1 opened this issue Jun 27, 2017 · 3 comments
Open

nth-child(odd) skips first node #32

sir4ju1 opened this issue Jun 27, 2017 · 3 comments

Comments

@sir4ju1
Copy link

sir4ju1 commented Jun 27, 2017

Machine Linux (GCC 7.1) and Windows (GCC 6.3)
Sample Code

        std::string page("<div><p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p></div>");
	CDocument doc;
	doc.parse(page.c_str());
	CSelection c = doc.find("p:nth-child(odd)");
	CNode node = c.nodeAt(0);

		
	std::cout << c.nodeNum() << std::endl;
	for (int i = 0; i < c.nodeNum(); i++)
	{
		CNode node = c.nodeAt(i);
		std::cout << "  " + node.text() << std::endl;
	}

Expected Output

3
  1
  3
  5

Original output

2
  3
  5
@TechnikEmpire
Copy link

TechnikEmpire commented Jun 29, 2017

There's a ton of broken functionality, some of it inherited from Cascadia (the source project this one was ported from), and some not. The project is dead also as there's been no activity from the author that I've seen in probably 2 years. I rewrote this library and fixed these issues in doing so and added tests, but you inherit some minor boost dependencies for use of string_ref. Boost has a modular system now via git submodules so you can just check out what's needed to get string_ref. I don't use my rewrite anymore but will be happy to fix anything that comes up.

@sir4ju1
Copy link
Author

sir4ju1 commented Jun 29, 2017

@TechnikEmpire thanks for the information and your work. checking now.

@TechnikEmpire
Copy link

@sir4ju1 Woops I didn't link. It's https://github.com/TechnikEmpire/GQ. I've made some changes recently that may make the build unclear. The VS project will be looking for boost in a specific location, you've gotta download it and edit/correct that. Feel free to open tickets on that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants