]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Correctly split multi-line part group names
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 28 Oct 2007 20:45:38 +0000 (21:45 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 28 Oct 2007 20:45:38 +0000 (21:45 +0100)
newlines might consist of \r, \n, or combinations thereof,
so we need to split at any combination of these.

python/musicexp.py

index 050ae66c03daed3ebeaa162d38ae673e53ffe505..d4f90827e2dd8b05fb05de4c29b1f502fdee02eb 100644 (file)
@@ -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 + "\"} "