juice icon indicating copy to clipboard operation
juice copied to clipboard

You can convert html to a string

Open koderhun opened this issue 8 years ago • 0 comments

html.replace in String(html).replace

And this error does not occur when working with SVG files

    html = html.replace(re, function(match, subMatch) {
                ^

TypeError: html.replace is not a function
    at /home/rtx/resourses/node_modules/juice/lib/cheerio.js:19:17
    at Array.forEach (native)
    at encodeCodeBlocks (/home/rtx/resourses/node_modules/juice/lib/cheerio.js:17:23)
    at encodeEntities (/home/rtx/resourses/node_modules/juice/lib/cheerio.js:38:10)
    at cheerioLoad (/home/rtx/resourses/node_modules/juice/lib/cheerio.js:11:10)
    at module.exports (/home/rtx/resourses/node_modules/juice/lib/cheerio.js:55:11)
    at /home/rtx/resourses/node_modules/juice/client.js:16:10
    at juiceFile (/home/rtx/resourses/toAttribute.js:13:12)
    at withFile (/home/rtx/resourses/toAttribute.js:22:28)
    at callIterator (/home/rtx/resourses/node_modules/each-file/index.js:46:7)

koderhun avatar May 06 '17 06:05 koderhun