diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-20 10:20:40 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-20 10:20:40 -0400 |
commit | a4d113a2f6648d7f97d29bbbd2634949a4050eb0 (patch) | |
tree | d74845850aa94bb8899ae175fe32a6ec08321e1a /bs4/__init__.py | |
parent | 9f370bad91d80570a57156f53c6a9efc918ff90f (diff) |
Gave new_string() the ability to create subclasses of
NavigableString. [bug=1181986]
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index a5e7a86..0195bcb 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -17,7 +17,7 @@ http://www.crummy.com/software/BeautifulSoup/bs4/doc/ """ __author__ = "Leonard Richardson (leonardr@segfault.org)" -__version__ = "4.2.0" +__version__ = "4.2.1" __copyright__ = "Copyright (c) 2004-2013 Leonard Richardson" __license__ = "MIT" @@ -201,9 +201,9 @@ class BeautifulSoup(Tag): """Create a new tag associated with this soup.""" return Tag(None, self.builder, name, namespace, nsprefix, attrs) - def new_string(self, s): + def new_string(self, s, subclass=NavigableString): """Create a new NavigableString associated with this soup.""" - navigable = NavigableString(s) + navigable = subclass(s) navigable.setup() return navigable |