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

fix(traversing): Make closest be able to start from text nodes #2811

Merged
merged 2 commits into from
Dec 12, 2022
Merged

fix(traversing): Make closest be able to start from text nodes #2811

merged 2 commits into from
Dec 12, 2022

Conversation

Qualtagh
Copy link
Contributor

In closest, make one extra step to parent if initial node isn't a tag node.

Fixes #2810

@fb55
Copy link
Member

fb55 commented Nov 28, 2022

Thanks a lot for this PR! The only reason this hasn't been merged yet is that I would want to ensure that no other method has similar issues, and this PR is my reminder. I will get to it eventually.

@fb55 fb55 merged commit 97f3739 into cheeriojs:main Dec 12, 2022
@fb55
Copy link
Member

fb55 commented Dec 12, 2022

Thanks a lot @Qualtagh

@Qualtagh
Copy link
Contributor Author

Thank you for merging. And thanks a lot for one of the most important NodeJS libraries! You do a great job 💪

renovate bot referenced this pull request in tomacheese/telcheck Aug 10, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cheerio](https://cheerio.js.org/)
([source](https://github.com/cheeriojs/cheerio)) | [`1.0.0-rc.12` ->
`1.0.0`](https://renovatebot.com/diffs/npm/cheerio/1.0.0-rc.12/1.0.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>cheeriojs/cheerio (cheerio)</summary>

###
[`v1.0.0`](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0)

[Compare
Source](https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0)

Cheerio 1.0 is here! 🎉

### [Announcement Blog Post](https://cheerio.js.org/blog/cheerio-1.0)

#### Breaking Changes

- The minimum NodeJS version is now 18.17 or higher
[https://github.com/cheeriojs/cheerio/pull/3959](https://github.com/cheeriojs/cheerio/pull/3959)

- Import paths were simplified. For example, use `cheerio/slim` instead
of
`cheerio/lib/slim`.
[https://github.com/cheeriojs/cheerio/pull/3970](https://github.com/cheeriojs/cheerio/pull/3970)

- The deprecated default Cheerio instance and static methods were
removed.
[https://github.com/cheeriojs/cheerio/pull/3974](https://github.com/cheeriojs/cheerio/pull/3974)

    Before, it was possible to write code like this:

    ```ts
    import cheerio, { html } from 'cheerio';

html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS
    ```

    Make sure to always load documents first:

    ```ts
    import * as cheerio from 'cheerio';

    cheerio.load('<test></test>').html();
    ```

- Node types previously re-exported by Cheerio must now be imported
directly
from (`domhandler`)(https://github.com/fb55/domhandler).
[https://github.com/cheeriojs/cheerio/pull/3969](https://github.com/cheeriojs/cheerio/pull/3969)

- htmlparser2 options now reside exclusively under the `xml` key
([https://github.com/cheeriojs/cheerio/pull/2916](https://github.com/cheeriojs/cheerio/pull/2916)):

    ```ts
    const $ = cheerio.load('<html>', {
      xml: {
        withStartIndices: true,
      },
    });
    ```

#### New Features

- Add functions to load buffers, streams & URLs in NodeJS by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2857](https://github.com/cheeriojs/cheerio/pull/2857)
- Add extract method by [@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2750](https://github.com/cheeriojs/cheerio/pull/2750)

#### Fixes

- Allow imports of `cheerio/utils` by
[@&#8203;blixt](https://github.com/blixt) in
[https://github.com/cheeriojs/cheerio/pull/2601](https://github.com/cheeriojs/cheerio/pull/2601)
- Allow empty string in `data`, and simplify by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2818](https://github.com/cheeriojs/cheerio/pull/2818)
- Make `closest` be able to start from text nodes by
[@&#8203;Qualtagh](https://github.com/Qualtagh) in
[https://github.com/cheeriojs/cheerio/pull/2811](https://github.com/cheeriojs/cheerio/pull/2811)
- Fix potential github action smells by
[@&#8203;ceddy4395](https://github.com/ceddy4395) in
[https://github.com/cheeriojs/cheerio/pull/3826](https://github.com/cheeriojs/cheerio/pull/3826)

#### Other

- Cheerio has [a new website](https://cheerio.js.org), featuring updated
API docs and guides!
[https://github.com/cheeriojs/cheerio/pull/2950](https://github.com/cheeriojs/cheerio/pull/2950)

**Full Changelog**:
cheeriojs/cheerio@v1.0.0-rc.12...v1.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/tomacheese/telcheck).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kodiakhq bot referenced this pull request in X-oss-byte/Canary-nextjs Aug 11, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cheerio](https://cheerio.js.org/) ([source](https://github.com/cheeriojs/cheerio)) | [`1.0.0-rc.12` -> `1.0.0`](https://renovatebot.com/diffs/npm/cheerio/1.0.0-rc.12/1.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>cheeriojs/cheerio (cheerio)</summary>

### [`v1.0.0`](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0)

[Compare Source](https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0)

Cheerio 1.0 is here! 🎉

### [Announcement Blog Post](https://cheerio.js.org/blog/cheerio-1.0)

#### Breaking Changes

-   The minimum NodeJS version is now 18.17 or higher [https://github.com/cheeriojs/cheerio/pull/3959](https://github.com/cheeriojs/cheerio/pull/3959)

-   Import paths were simplified. For example, use `cheerio/slim` instead of
    `cheerio/lib/slim`. [https://github.com/cheeriojs/cheerio/pull/3970](https://github.com/cheeriojs/cheerio/pull/3970)

-   The deprecated default Cheerio instance and static methods were removed. [https://github.com/cheeriojs/cheerio/pull/3974](https://github.com/cheeriojs/cheerio/pull/3974)

    Before, it was possible to write code like this:

    ```ts
    import cheerio, { html } from 'cheerio';

    html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS
    ```

    Make sure to always load documents first:

    ```ts
    import * as cheerio from 'cheerio';

    cheerio.load('<test></test>').html();
    ```

-   Node types previously re-exported by Cheerio must now be imported directly
    from (`domhandler`)(https://github.com/fb55/domhandler). [https://github.com/cheeriojs/cheerio/pull/3969](https://github.com/cheeriojs/cheerio/pull/3969)

-   htmlparser2 options now reside exclusively under the `xml` key ([https://github.com/cheeriojs/cheerio/pull/2916](https://github.com/cheeriojs/cheerio/pull/2916)):

    ```ts
    const $ = cheerio.load('<html>', {
      xml: {
        withStartIndices: true,
      },
    });
    ```

#### New Features

-   Add functions to load buffers, streams & URLs in NodeJS by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2857](https://github.com/cheeriojs/cheerio/pull/2857)
-   Add extract method by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2750](https://github.com/cheeriojs/cheerio/pull/2750)

#### Fixes

-   Allow imports of `cheerio/utils` by [@&#8203;blixt](https://github.com/blixt) in [https://github.com/cheeriojs/cheerio/pull/2601](https://github.com/cheeriojs/cheerio/pull/2601)
-   Allow empty string in `data`, and simplify by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2818](https://github.com/cheeriojs/cheerio/pull/2818)
-   Make `closest` be able to start from text nodes by [@&#8203;Qualtagh](https://github.com/Qualtagh) in [https://github.com/cheeriojs/cheerio/pull/2811](https://github.com/cheeriojs/cheerio/pull/2811)
-   Fix potential github action smells by [@&#8203;ceddy4395](https://github.com/ceddy4395) in [https://github.com/cheeriojs/cheerio/pull/3826](https://github.com/cheeriojs/cheerio/pull/3826)

#### Other

-   Cheerio has [a new website](https://cheerio.js.org), featuring updated API docs and guides! [https://github.com/cheeriojs/cheerio/pull/2950](https://github.com/cheeriojs/cheerio/pull/2950)

**Full Changelog**: cheeriojs/cheerio@v1.0.0-rc.12...v1.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/X-oss-byte/Canary-nextjs).
kodiakhq bot referenced this pull request in X-oss-byte/Nextjs Aug 12, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cheerio](https://cheerio.js.org/) ([source](https://github.com/cheeriojs/cheerio)) | [`1.0.0-rc.12` -> `1.0.0`](https://renovatebot.com/diffs/npm/cheerio/1.0.0-rc.12/1.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [cheerio](https://cheerio.js.org/) ([source](https://github.com/cheeriojs/cheerio)) | [`0.22.0` -> `1.0.0`](https://renovatebot.com/diffs/npm/cheerio/0.22.0/1.0.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/0.22.0/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/0.22.0/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>cheeriojs/cheerio (cheerio)</summary>

### [`v1.0.0`](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0)

[Compare Source](https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0)

Cheerio 1.0 is here! 🎉

### [Announcement Blog Post](https://cheerio.js.org/blog/cheerio-1.0)

#### Breaking Changes

-   The minimum NodeJS version is now 18.17 or higher [https://github.com/cheeriojs/cheerio/pull/3959](https://github.com/cheeriojs/cheerio/pull/3959)

-   Import paths were simplified. For example, use `cheerio/slim` instead of
    `cheerio/lib/slim`. [https://github.com/cheeriojs/cheerio/pull/3970](https://github.com/cheeriojs/cheerio/pull/3970)

-   The deprecated default Cheerio instance and static methods were removed. [https://github.com/cheeriojs/cheerio/pull/3974](https://github.com/cheeriojs/cheerio/pull/3974)

    Before, it was possible to write code like this:

    ```ts
    import cheerio, { html } from 'cheerio';

    html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS
    ```

    Make sure to always load documents first:

    ```ts
    import * as cheerio from 'cheerio';

    cheerio.load('<test></test>').html();
    ```

-   Node types previously re-exported by Cheerio must now be imported directly
    from (`domhandler`)(https://github.com/fb55/domhandler). [https://github.com/cheeriojs/cheerio/pull/3969](https://github.com/cheeriojs/cheerio/pull/3969)

-   htmlparser2 options now reside exclusively under the `xml` key ([https://github.com/cheeriojs/cheerio/pull/2916](https://github.com/cheeriojs/cheerio/pull/2916)):

    ```ts
    const $ = cheerio.load('<html>', {
      xml: {
        withStartIndices: true,
      },
    });
    ```

#### New Features

-   Add functions to load buffers, streams & URLs in NodeJS by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2857](https://github.com/cheeriojs/cheerio/pull/2857)
-   Add extract method by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2750](https://github.com/cheeriojs/cheerio/pull/2750)

#### Fixes

-   Allow imports of `cheerio/utils` by [@&#8203;blixt](https://github.com/blixt) in [https://github.com/cheeriojs/cheerio/pull/2601](https://github.com/cheeriojs/cheerio/pull/2601)
-   Allow empty string in `data`, and simplify by [@&#8203;fb55](https://github.com/fb55) in [https://github.com/cheeriojs/cheerio/pull/2818](https://github.com/cheeriojs/cheerio/pull/2818)
-   Make `closest` be able to start from text nodes by [@&#8203;Qualtagh](https://github.com/Qualtagh) in [https://github.com/cheeriojs/cheerio/pull/2811](https://github.com/cheeriojs/cheerio/pull/2811)
-   Fix potential github action smells by [@&#8203;ceddy4395](https://github.com/ceddy4395) in [https://github.com/cheeriojs/cheerio/pull/3826](https://github.com/cheeriojs/cheerio/pull/3826)

#### Other

-   Cheerio has [a new website](https://cheerio.js.org), featuring updated API docs and guides! [https://github.com/cheeriojs/cheerio/pull/2950](https://github.com/cheeriojs/cheerio/pull/2950)

**Full Changelog**: cheeriojs/cheerio@v1.0.0-rc.12...v1.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/X-oss-byte/Nextjs).
renovate bot referenced this pull request in redwoodjs/redwood Aug 12, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cheerio](https://cheerio.js.org/)
([source](https://github.com/cheeriojs/cheerio)) | [`1.0.0-rc.12` ->
`1.0.0`](https://renovatebot.com/diffs/npm/cheerio/1.0.0-rc.12/1.0.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>cheeriojs/cheerio (cheerio)</summary>

###
[`v1.0.0`](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0)

[Compare
Source](https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0)

Cheerio 1.0 is here! 🎉

### [Announcement Blog Post](https://cheerio.js.org/blog/cheerio-1.0)

#### Breaking Changes

- The minimum NodeJS version is now 18.17 or higher
[https://github.com/cheeriojs/cheerio/pull/3959](https://github.com/cheeriojs/cheerio/pull/3959)

- Import paths were simplified. For example, use `cheerio/slim` instead
of
`cheerio/lib/slim`.
[https://github.com/cheeriojs/cheerio/pull/3970](https://github.com/cheeriojs/cheerio/pull/3970)

- The deprecated default Cheerio instance and static methods were
removed.
[https://github.com/cheeriojs/cheerio/pull/3974](https://github.com/cheeriojs/cheerio/pull/3974)

    Before, it was possible to write code like this:

    ```ts
    import cheerio, { html } from 'cheerio';

html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS
    ```

    Make sure to always load documents first:

    ```ts
    import * as cheerio from 'cheerio';

    cheerio.load('<test></test>').html();
    ```

- Node types previously re-exported by Cheerio must now be imported
directly
from (`domhandler`)(https://github.com/fb55/domhandler).
[https://github.com/cheeriojs/cheerio/pull/3969](https://github.com/cheeriojs/cheerio/pull/3969)

- htmlparser2 options now reside exclusively under the `xml` key
([https://github.com/cheeriojs/cheerio/pull/2916](https://github.com/cheeriojs/cheerio/pull/2916)):

    ```ts
    const $ = cheerio.load('<html>', {
      xml: {
        withStartIndices: true,
      },
    });
    ```

#### New Features

- Add functions to load buffers, streams & URLs in NodeJS by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2857](https://github.com/cheeriojs/cheerio/pull/2857)
- Add extract method by [@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2750](https://github.com/cheeriojs/cheerio/pull/2750)

#### Fixes

- Allow imports of `cheerio/utils` by
[@&#8203;blixt](https://github.com/blixt) in
[https://github.com/cheeriojs/cheerio/pull/2601](https://github.com/cheeriojs/cheerio/pull/2601)
- Allow empty string in `data`, and simplify by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2818](https://github.com/cheeriojs/cheerio/pull/2818)
- Make `closest` be able to start from text nodes by
[@&#8203;Qualtagh](https://github.com/Qualtagh) in
[https://github.com/cheeriojs/cheerio/pull/2811](https://github.com/cheeriojs/cheerio/pull/2811)
- Fix potential github action smells by
[@&#8203;ceddy4395](https://github.com/ceddy4395) in
[https://github.com/cheeriojs/cheerio/pull/3826](https://github.com/cheeriojs/cheerio/pull/3826)

#### Other

- Cheerio has [a new website](https://cheerio.js.org), featuring updated
API docs and guides!
[https://github.com/cheeriojs/cheerio/pull/2950](https://github.com/cheeriojs/cheerio/pull/2950)

**Full Changelog**:
cheeriojs/cheerio@v1.0.0-rc.12...v1.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/redwoodjs/redwood).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yMC4xIiwidXBkYXRlZEluVmVyIjoiMzguMjAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
benelan referenced this pull request in Esri/calcite-design-system Aug 16, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [cheerio](https://cheerio.js.org/)
([source](https://github.com/cheeriojs/cheerio)) | [`1.0.0-rc.12` ->
`1.0.0`](https://renovatebot.com/diffs/npm/cheerio/1.0.0-rc.12/1.0.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/cheerio/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/cheerio/1.0.0-rc.12/1.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>cheeriojs/cheerio (cheerio)</summary>

###
[`v1.0.0`](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0)

[Compare
Source](https://github.com/cheeriojs/cheerio/compare/v1.0.0-rc.12...v1.0.0)

Cheerio 1.0 is here! 🎉

### [Announcement Blog Post](https://cheerio.js.org/blog/cheerio-1.0)

#### Breaking Changes

- The minimum NodeJS version is now 18.17 or higher
[https://github.com/cheeriojs/cheerio/pull/3959](https://github.com/cheeriojs/cheerio/pull/3959)

- Import paths were simplified. For example, use `cheerio/slim` instead
of
`cheerio/lib/slim`.
[https://github.com/cheeriojs/cheerio/pull/3970](https://github.com/cheeriojs/cheerio/pull/3970)

- The deprecated default Cheerio instance and static methods were
removed.
[https://github.com/cheeriojs/cheerio/pull/3974](https://github.com/cheeriojs/cheerio/pull/3974)

    Before, it was possible to write code like this:

    ```ts
    import cheerio, { html } from 'cheerio';

html(cheerio('<test></test>')); // ~ '<test></test>' -- NO LONGER WORKS
    ```

    Make sure to always load documents first:

    ```ts
    import * as cheerio from 'cheerio';

    cheerio.load('<test></test>').html();
    ```

- Node types previously re-exported by Cheerio must now be imported
directly
from (`domhandler`)(https://github.com/fb55/domhandler).
[https://github.com/cheeriojs/cheerio/pull/3969](https://github.com/cheeriojs/cheerio/pull/3969)

- htmlparser2 options now reside exclusively under the `xml` key
([https://github.com/cheeriojs/cheerio/pull/2916](https://github.com/cheeriojs/cheerio/pull/2916)):

    ```ts
    const $ = cheerio.load('<html>', {
      xml: {
        withStartIndices: true,
      },
    });
    ```

#### New Features

- Add functions to load buffers, streams & URLs in NodeJS by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2857](https://github.com/cheeriojs/cheerio/pull/2857)
- Add extract method by [@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2750](https://github.com/cheeriojs/cheerio/pull/2750)

#### Fixes

- Allow imports of `cheerio/utils` by
[@&#8203;blixt](https://github.com/blixt) in
[https://github.com/cheeriojs/cheerio/pull/2601](https://github.com/cheeriojs/cheerio/pull/2601)
- Allow empty string in `data`, and simplify by
[@&#8203;fb55](https://github.com/fb55) in
[https://github.com/cheeriojs/cheerio/pull/2818](https://github.com/cheeriojs/cheerio/pull/2818)
- Make `closest` be able to start from text nodes by
[@&#8203;Qualtagh](https://github.com/Qualtagh) in
[https://github.com/cheeriojs/cheerio/pull/2811](https://github.com/cheeriojs/cheerio/pull/2811)
- Fix potential github action smells by
[@&#8203;ceddy4395](https://github.com/ceddy4395) in
[https://github.com/cheeriojs/cheerio/pull/3826](https://github.com/cheeriojs/cheerio/pull/3826)

#### Other

- Cheerio has [a new website](https://cheerio.js.org), featuring updated
API docs and guides!
[https://github.com/cheeriojs/cheerio/pull/2950](https://github.com/cheeriojs/cheerio/pull/2950)

**Full Changelog**:
cheeriojs/cheerio@v1.0.0-rc.12...v1.0.0

</details>

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6ImRldiIsImxhYmVscyI6WyJjaG9yZSIsImRlcGVuZGVuY2llcyJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ben Elan <no-reply@benelan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

closest() should be able to start from text nodes
2 participants