Instead of repeating the entire sub, could we just switch out the pattern? For example:

```
if "break-on-newline" in self.extras:
    _break_re = r" *\n" 
else r" {2,}\n":
    _break_re = r" {2,}\n"
text = re.sub(_break_re, " <br%s\n" % self.empty_element_suffix, text)
```