N
N
Nikolai2019-03-12 18:47:39
npm
Nikolai, 2019-03-12 18:47:39

Why are the attributes not being removed?

I want to remove all [fill] [stroke] [style] attributes from elements that are in the symbol tag whose id starts with "mono". What am I doing wrong?

.pipe(cheerio({
      run: function ($) {
        $('symbol[id^="mono"] [fill]').removeAttr('fill');
        $('symbol[id^="mono"] [stroke]').removeAttr('stroke');
        $('symbol[id^="mono"] [style]').removeAttr('style');
      },
      parserOptions: {xmlMode: true}
    }))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question