From 59b852e23b0d0e48d47e567ad20203d113795bd6 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 28 Oct 2007 21:45:38 +0100 Subject: [PATCH] MusicXML: Correctly split multi-line part group names newlines might consist of \r, \n, or combinations thereof, so we need to split at any combination of these. --- python/musicexp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/musicexp.py b/python/musicexp.py index 050ae66c03..d4f90827e2 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -8,8 +8,9 @@ from rational import Rational def escape_instrument_string (input_string): retstring = string.replace (input_string, "\"", "\\\"") - if re.match ('.*\n.*', retstring): - strings = retstring.split ('\r\n') + if re.match ('.*[\r\n]+.*', retstring): + rx = re.compile (r'[\n\r]+') + strings = rx.split (retstring) retstring = "\\markup { \\column { " for s in strings: retstring += "\\line {\"" + s + "\"} " -- 2.39.5