From b0508df41dbc5a848566c659d8882a772366bb84 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 7 Feb 2012 19:18:03 -0500 Subject: Renamed insert_before to move_before, to avoid confusion with the way insert() works. --- 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 8e35f0e..75be6da 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1516,23 +1516,23 @@ say. It works just like ``.insert()`` on a Python list:: tag.contents # [u'I linked to ', u'but did not endorse', example.com] -``insert_before()`` and ``insert_after()`` +``move_before()`` and ``move_after()`` ------------------------------------------ -The ``insert_before()`` method adds a tag or string to the parse tree +The ``move_before()`` method adds a tag or string to the parse tree immediately before something else:: soup = BeautifulSoup("stop") tag = soup.new_tag("i") tag.string = "Don't" - tag.insert_before(soup.b.string) + tag.move_before(soup.b.string) soup.b # Don'tstop -The ``insert_after()`` method adds a tag or string to the parse tree +The ``move_after()`` method adds a tag or string to the parse tree immediately `after` something else:: - soup.new_string(" ever ").insert_after(soup.b.i) + soup.new_string(" ever ").move_after(soup.b.i) soup.b # Don't ever stop soup.b.contents -- cgit v1.2.3