summaryrefslogtreecommitdiff
path: root/bs4/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r--bs4/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py
index 3714d67..7c6044a 100644
--- a/bs4/__init__.py
+++ b/bs4/__init__.py
@@ -497,7 +497,7 @@ class BeautifulSoup(Tag):
# On top of that, we may be inside a tag that needs a special
# container class.
- if self.string_container_stack:
+ if self.string_container_stack and container is NavigableString:
container = self.builder.string_containers.get(
self.string_container_stack[-1].name, container
)