(self, markup)
| 80 | self.doc.write(markup) |
| 81 | |
| 82 | def _end_inline(self, markup): |
| 83 | # Sometimes the HTML markup has whitespace between the end |
| 84 | # of the text inside the inline markup and the closing element |
| 85 | # (e.g. <b>foobar </b>). This trailing space will cause |
| 86 | # problems in the ReST inline markup so we remove it here |
| 87 | # by popping the last item written off the stack, striping |
| 88 | # the whitespace and then pushing it back on the stack. |
| 89 | last_write = self.doc.pop_write().rstrip(' ') |
| 90 | |
| 91 | # Sometimes, for whatever reason, a tag like <b/> is present. This |
| 92 | # is problematic because if we simply translate that directly then |
| 93 | # we end up with something like ****, which rst will assume is a |
| 94 | # heading instead of an empty bold. |
| 95 | if last_write == markup: |
| 96 | return |
| 97 | |
| 98 | self.doc.push_write(last_write) |
| 99 | self.doc.write(markup + ' ') |
| 100 | |
| 101 | def start_bold(self, attrs=None): |
| 102 | self._start_inline('**') |
no test coverage detected