custom line breaks more robust refs #21
This commit is contained in:
parent
a0f60bc1c7
commit
e72efbd156
@ -114,7 +114,16 @@
|
|||||||
(make-custom-linebreaks
|
(make-custom-linebreaks
|
||||||
(cdr break-words)
|
(cdr break-words)
|
||||||
(ly:regex-replace
|
(ly:regex-replace
|
||||||
(ly:make-regex (string-append "(" (ly:regex-replace (ly:make-regex "(.)") (car break-words) "(?: *,[^,)]+\\)" 1 "|\\(?" 1 ")") "(?: *,[^,)]+\\))?)(.*)$"))
|
(ly:make-regex
|
||||||
|
(string-append
|
||||||
|
"("
|
||||||
|
(string-concatenate
|
||||||
|
(map
|
||||||
|
(lambda (character)
|
||||||
|
(let ((escaped_char (ly:regex-quote (string character))))
|
||||||
|
(string-append "(?: *,[^,)]+\\)" escaped_char "|\\(?" escaped_char ")")))
|
||||||
|
(string->list (car break-words))))
|
||||||
|
"(?: *,[^,)]+\\))?)(.*)$"))
|
||||||
newtext
|
newtext
|
||||||
1 "\n" 2))))))
|
1 "\n" 2))))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user