From d1261fb0a2df9929658dfdc9fe5880974e287d21 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Thu, 26 Apr 2012 12:55:59 -0400 Subject: Renamed replace_with_children() to the jQuery name, unwrap(). --- doc/source/index.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/source') diff --git a/doc/source/index.rst b/doc/source/index.rst index 17d2211..ef60c24 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1894,21 +1894,21 @@ and replaces it with the tag or string of your choice:: ``replace_with()`` returns the tag or string that was replaced, so that you can examine it or add it back to another part of the tree. -``replace_with_children()`` +``unwrap()`` --------------------------- -``Tag.replace_with_children()`` replaces a tag with whatever's inside +``Tag.unwrap()`` replaces a tag with whatever's inside that tag. It's good for stripping out markup:: markup = 'I linked to example.com' soup = BeautifulSoup(markup) a_tag = soup.a - a_tag.i.replace_with_children() + a_tag.i.unwrap() a_tag # I linked to example.com -Like ``replace_with()``, ``replace_with_children()`` returns the tag +Like ``replace_with()``, ``unwrap()`` returns the tag that was replaced. Output @@ -2696,7 +2696,7 @@ Method names * ``renderContents`` -> ``encode_contents`` * ``replaceWith`` -> ``replace_with`` -* ``replaceWithChildren`` -> ``replace_with_children`` +* ``replaceWithChildren`` -> ``unwrap`` * ``findAll`` -> ``find_all`` * ``findAllNext`` -> ``find_all_next`` * ``findAllPrevious`` -> ``find_all_previous`` -- cgit v1.2.3