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

Could I select a custom tag like <aaa></aaa>? #3218

Open
Fish1230 opened this issue May 30, 2023 · 0 comments
Open

Could I select a custom tag like <aaa></aaa>? #3218

Fish1230 opened this issue May 30, 2023 · 0 comments

Comments

@Fish1230
Copy link

Fish1230 commented May 30, 2023

I want a feature like this ,I have a template html file,there are some custom tag with a custom attribute,like,, I want to replace all the attribute hello's value in tag aaa.I used like this ,

    import * as cheerio from 'cheerio'

    const str=" <aaa hello="123"></aaa><aaa hello="asad"></aaa>";
    const $ = cheerio.load(str);
    const $("aaa").attr('hello',"world");
    console.log($.html());
  //expect
 <aaa hello="world"></aaa><aaa hello="world"></aaa>

but found nothing,so I suppose cheerio cannot select a custom tag.

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

1 participant