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
According to the documentation for Cheerio<T>.html(), it returns the content of the element—that is, its innerHTML rather than its outerHTML. This matches the current behavior. However, many documentation examples are written as though it returns the outerHTML. For example, this is the code snippet from Cheerio<T>.addClass():
$('.pear').addClass('fruit').html();//=> <li class="pear fruit">Pear</li>$('.apple').addClass('fruit red').html();//=> <li class="apple fruit red">Apple</li>
According to the documentation for
Cheerio<T>.html()
, it returns the content of the element—that is, itsinnerHTML
rather than itsouterHTML
. This matches the current behavior. However, many documentation examples are written as though it returns theouterHTML
. For example, this is the code snippet fromCheerio<T>.addClass()
:We can test this in the browser's dev inspector:
where it prints
rather than the documented output values.
The text was updated successfully, but these errors were encountered: