Append the string (or BabelString instance) to the last textbox in galley, if it exists. Otherwise create a new Text and add it to self.galley.
(self, bs)
| 550 | return mergedStyle |
| 551 | |
| 552 | def append(self, bs): |
| 553 | """Append the string (or BabelString instance) to the last textbox in |
| 554 | galley, if it exists. Otherwise create a new Text and add it to |
| 555 | self.galley.""" |
| 556 | if self.galley.elements and self.galley.elements[-1].isText: |
| 557 | box = self.galley.elements[-1] |
| 558 | if box.bs is None: |
| 559 | box.bs = bs |
| 560 | else: |
| 561 | box.bs += bs |
| 562 | elif hasattr(bs, 's'): |
| 563 | s = bs.s |
| 564 | while s and s[0] in ' \t\n\r': |
| 565 | s = s[1:] |
| 566 | bs.s = s |
| 567 | self.TEXTBOX_CLASS(bs, parent=self.galley) |
| 568 | else: |
| 569 | self.TEXTBOX_CLASS(bs, parent=self.galley) |
| 570 | |
| 571 | def htmlNode(self, node, end=False): |
| 572 | """Open the tag in HTML output and copy the node attributes if there are any.""" |
no outgoing calls
no test coverage detected