You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure exactly what's going on - but looks like when they're set they're not being converted into a string, so when you try to change them later it's not behaving properly.
(Pseudo code as this was found in a larger project)
$("span").html(123).html(123) silently fills it with an empty string.
$("span").text(123).text(123) causes an exception -
Warning: Object 312 has no method 'replace' Use --force to continue.
TypeError: Object 312 has no method 'replace'
at Object.encodeXML (...\node_modules\cheerio\node_modules\entities\lib\encode.js:58:6)
at renderText (...\node_modules\cheerio\node_modules\dom-serializer\index.js:166:21)
at module.exports (...\node_modules\cheerio\node_modules\dom-serializer\index.js:121:17)
at renderTag (...\node_modules\cheerio\node_modules\dom-serializer\index.js:146:14)
at module.exports (...\node_modules\cheerio\node_modules\dom-serializer\index.js:113:17)
at renderTag (...\node_modules\cheerio\node_modules\dom-serializer\index.js:146:14)
at module.exports (...\node_modules\cheerio\node_modules\dom-serializer\index.js:113:17)
at renderTag (...\node_modules\cheerio\node_modules\dom-serializer\index.js:146:14)
at module.exports ...\node_modules\cheerio\node_modules\dom-serializer
\index.js:113:17)
at renderTag (...\node_modules\cheerio\node_modules\dom-serializer\inde
x.js:146:14)
Both $("span").html("" + 123).html("" + 123) and $("span").text("" + 123).text("" + 123) work as expected.
Maybe coerce the type at some point?
The text was updated successfully, but these errors were encountered:
Not sure exactly what's going on - but looks like when they're set they're not being converted into a string, so when you try to change them later it's not behaving properly.
(Pseudo code as this was found in a larger project)
$("span").html(123).html(123) silently fills it with an empty string.
$("span").text(123).text(123) causes an exception -
Both
$("span").html("" + 123).html("" + 123)
and$("span").text("" + 123).text("" + 123)
work as expected.Maybe coerce the type at some point?
The text was updated successfully, but these errors were encountered: