For some reason this doesn't happen very often, but I just saw it for
the first time, and it totally confused Paragraph and also
ColouredString.frags. Avoid getting into that sitation in the first
place.
assert len(colour) == 1, "Colour ids are single characters"
colour = colour * len(string)
self.s, self.c = string, colour
+ assert '\n' not in self.s, "Newlines ought to be handled elsewhere"
self.width = cached_wcswidth(self.s)
def __add__(self, rhs):
return
def handle_data(self, data):
+ data = data.replace('\n', ' ')
self.paras[-1].add(ColouredString(data, self.colourstack[-1]))
def done(self):