diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-07 19:18:03 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-07 19:18:03 -0500 |
commit | b0508df41dbc5a848566c659d8882a772366bb84 (patch) | |
tree | 14174c14e4c09084b542fe1538fe9d2755235fa5 /doc/source | |
parent | 6590573e18a533f30c9635ecbd6af163d6826ef8 (diff) |
Renamed insert_before to move_before, to avoid confusion with the way insert() works.
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/index.rst | 10 |
1 files changed, 5 insertions, 5 deletions
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', <i>example.com</i>] -``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("<b>stop</b>") tag = soup.new_tag("i") tag.string = "Don't" - tag.insert_before(soup.b.string) + tag.move_before(soup.b.string) soup.b # <b><i>Don't</i>stop</b> -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 # <b><i>Don't</i> ever stop</b> soup.b.contents |