Skip to content

2.0.0

Latest
Compare
Choose a tag to compare
@tinfoilboy tinfoilboy released this 30 Dec 03:01
· 2 commits to master since this release

Selectors!

I had the functionality for selector parsing in the library for a couple of months but it only was ever used for element construction. I had been meaning to implement selector search for awhile but hadn't been able to find the time. Though, now is that time. You can now search for elements using their selector with the new CTML::Node::QuerySelector(const std::string&) method. This method reflects how querySelectorAll works in JavaScript on a browser, and tries to be a faithful recreation of that.

I also added the ability to construct multiple elements with the selector construction method. For instance if you use the following code:

CTML::Node node("div#first section#second article#third");

This will create a document like the following:

<div id="first">
    <section id="second">
        <article id="third">
        </article>
    </section>
</div>

Enjoy the new selector functionality! Keep in mind that there may be some breaking changes with this release.