(self, containerClass=NavigableString)
| 1237 | self.currentTag = self.tagStack[-1] |
| 1238 | |
| 1239 | def endData(self, containerClass=NavigableString): |
| 1240 | if self.currentData: |
| 1241 | currentData = u''.join(self.currentData) |
| 1242 | if (currentData.translate(self.STRIP_ASCII_SPACES) == '' and |
| 1243 | not set([tag.name for tag in self.tagStack]).intersection( |
| 1244 | self.PRESERVE_WHITESPACE_TAGS)): |
| 1245 | if '\n' in currentData: |
| 1246 | currentData = '\n' |
| 1247 | else: |
| 1248 | currentData = ' ' |
| 1249 | self.currentData = [] |
| 1250 | if self.parseOnlyThese and len(self.tagStack) <= 1 and \ |
| 1251 | (not self.parseOnlyThese.text or \ |
| 1252 | not self.parseOnlyThese.search(currentData)): |
| 1253 | return |
| 1254 | o = containerClass(currentData) |
| 1255 | o.setup(self.currentTag, self.previous) |
| 1256 | if self.previous: |
| 1257 | self.previous.next = o |
| 1258 | self.previous = o |
| 1259 | self.currentTag.contents.append(o) |
| 1260 | |
| 1261 | |
| 1262 | def _popToTag(self, name, inclusivePop=True): |
no test coverage detected