diff options
-rw-r--r-- | bs4/element.py | 2 | ||||
-rw-r--r-- | doc/source/index.rst | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/bs4/element.py b/bs4/element.py index c70ad5a..336768b 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -294,6 +294,8 @@ class PageElement(object): _lastRecursiveChild = _last_descendant def insert(self, position, new_child): + if new_child is None: + raise ValueError("Cannot insert None into a tag.") if new_child is self: raise ValueError("Cannot insert a tag into itself.") if (isinstance(new_child, basestring) diff --git a/doc/source/index.rst b/doc/source/index.rst index ba3b54e..3bc9537 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -29,7 +29,7 @@ Soup 3 and Beautiful Soup 4, see `Porting code to BS4`_. This documentation has been translated into other languages by Beautiful Soup users: -* `这篇文档当然还有中文版. <http://www.crummy.com/software/BeautifulSoup/bs4/doc/index.cn.html>`_ +* `这篇文档当然还有中文版. <http://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/>`_ * このページは日本語で利用できます(`外部リンク <http://kondou.com/BS4/>`_) * 이 문서는 한국어 번역도 가능합니다. (`외부 링크 <http://coreapython.hosting.paran.com/etc/beautifulsoup4.html>`_) |