Add the HTML chunk to self.html, the ordered list of HTML for output. Test if the html is a plain string or of type HtmlString(BabelString). Otherwise raise an error, because we don't want to support BabelString conversion. They should have been created of the right t
(self, html)
| 578 | # H T M L |
| 579 | |
| 580 | def addHtml(self, html): |
| 581 | """Add the HTML chunk to self.html, the ordered list of HTML for |
| 582 | output. Test if the html is a plain string or of type |
| 583 | HtmlString(BabelString). Otherwise raise an error, because we don't |
| 584 | want to support BabelString conversion. They should have been created |
| 585 | of the right type in the context from the start.""" |
| 586 | |
| 587 | #if not isinstance(html, str): # It's something else, test on the kind of BabelString. |
| 588 | # assert isinstance(html, HtmlString) |
| 589 | try: |
| 590 | assert isinstance(html.s, str) |
| 591 | html = html.s # Get the collected html from the BabelString. |
| 592 | except AttributeError: |
| 593 | |
| 594 | html = str(html) # Make sure it is a string |
| 595 | self._htmlOut.append(html) |
| 596 | |
| 597 | write = addHtml |
| 598 |
no test coverage detected