- def _emph_repl(self, word):
- if len(word) == 3:
- self.is_b = not self.is_b
- return ['</strong>', '<strong>'][self.is_b]
- else:
- self.is_em = not self.is_em
- return ['</em>', '<em>'][self.is_em]
+ def _b_repl(self, word):
+ self.in_b = not self.in_b
+ return ['</strong>', '<strong>'][self.in_b]
+
+ def _em_repl(self, word):
+ self.in_em = not self.in_em
+ return ['</em>', '<em>'][self.in_em]