Skip to content

[Snyk] Upgrade truncate-html from 1.0.3 to 1.2.2#60

Open
YoshiWalsh wants to merge 1 commit into
developfrom
snyk-upgrade-aaf914d64580c1c02b86c0811808309a
Open

[Snyk] Upgrade truncate-html from 1.0.3 to 1.2.2#60
YoshiWalsh wants to merge 1 commit into
developfrom
snyk-upgrade-aaf914d64580c1c02b86c0811808309a

Conversation

@YoshiWalsh
Copy link
Copy Markdown
Owner

snyk-top-banner

Snyk has created this PR to upgrade truncate-html from 1.0.3 to 1.2.2.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 10 versions ahead of your current version.

  • The recommended version was released a month ago.

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
high severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-NTHCHECK-1586032
586 Proof of Concept
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-CSSWHAT-3035488
586 Proof of Concept
Release notes
Package name: truncate-html
  • 1.2.2 - 2025-06-14

    v1.2.2

  • 1.2.1 - 2025-03-18

    v1.2.1

  • 1.2.0 - 2025-01-20

    A new option customNodeStrategy has been added. Check readme for details.

    For your requirements, the following code may achieve your needs:

    import truncate, { type IOptions, type ICustomNodeStrategy } from 'truncate-html'

    // argument node is a cheerio instance
    const customNodeStrategy: ICustomNodeStrategy = node => {
    // keep details and treat it as nothing inside
    if (node.is('details')) {
    return 'keep'
    }
    }

    const html = '<div><details><summary>Click me</summary><p>Some details</p></details>other things</div>'

    const options: IOptions = {
    length: 3,
    customNodeStrategy
    }

    truncate(html, options)
    // => <div><details><summary>Click me</summary><p>Some details</p></details>oth...</div>

    ref: #41

  • 1.2.0-beta.1 - 2024-10-12

    v1.2.0-beta.1

  • 1.1.2 - 2024-08-15

    Cheerio released stable v1.0 a few days ago, but its APIs are very different from the latest beta version 1.0.0-rc.12, which breaks this lib.

    The v1.1.2 release has pinned the cheerio version to 1.0.0-rc.12 to fix the cheerio problem.

    Reference:

    1. Cheerio 1.0 released, batteries included 🔋
    2. cheerio#4024, more issues about cheerio

    Cheerio spent years on beta version of 1.0, and then bring so many break changes in stable version? Unbelievable!

  • 1.1.1 - 2024-03-02
    No content.
  • 1.1.0 - 2024-03-02

    There are several changes:

    1. no vulnerabilities
      CleanShot 2023-06-17 at 20 37 48
    2. cheerio can now handle CJK characters correctly
    3. if you are using custom cheerio instance with this library, you should set the third parameter of cheerio.load to false to get rid of extra wrappers, see load for details.
    4. better support for typescript
  • 1.0.5-beta.2 - 2023-06-17

    v1.0.5-beta.2

  • 1.0.5-beta.1 - 2023-06-17

    v1.0.5-beta.1

  • 1.0.4 - 2021-07-09

    fix: fix type define issues, fixs #32

  • 1.0.3 - 2019-08-14
from truncate-html GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade truncate-html from 1.0.3 to 1.2.2.

See this package in npm:
truncate-html

See this project in Snyk:
https://app.snyk.io/org/joshuawalsh/project/f429e8ca-f9cd-4ebf-a425-40a0d88abc3c?utm_source=github&utm_medium=referral&page=upgrade-pr
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

Successfully merging this pull request may close these issues.

2 participants