From 59517b3245ef00130e07f29483aa5b9841178d6e Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 25 Jul 2014 13:21:24 +0200 Subject: [PATCH] Removing leading spaces and line breaks in verses --- patacrep/plastex_chord.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patacrep/plastex_chord.py b/patacrep/plastex_chord.py index 5cf5caad..160682d3 100644 --- a/patacrep/plastex_chord.py +++ b/patacrep/plastex_chord.py @@ -37,6 +37,15 @@ def wrap_displaymath(cls): self.ownerDocument.context.push() self.ownerDocument.context.catcode("\n", 13) IN_VERSE += 1 + + # Removing spaces and line breaks at the beginning of verse + token = None + for token in tex: + if not match_space(token): + break + if token is not None: + tex.pushToken(token) + else: self.ownerDocument.context.pop() IN_VERSE -= 1