diff options
author | Thomas Morley <thomasmorley65@gmail.com> | 2016-03-16 00:10:20 +0100 |
---|---|---|
committer | Thomas Morley <thomasmorley65@gmail.com> | 2016-03-31 14:42:13 +0200 |
commit | 6992c0bd640070493aeedcdb9f95be7c206e47d6 (patch) | |
tree | 68ff151a702050f21f297cd08c818f32ab7905f3 /ly | |
parent | f938685c1aa5af0316d762068577460c8fc663e6 (diff) |
Issue 4809 Keep "\""-signs for graphviz
Transform them to "\\\""
Diffstat (limited to 'ly')
-rw-r--r-- | ly/graphviz-init.ly | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ly/graphviz-init.ly b/ly/graphviz-init.ly index 470faffa6a..96f45ded93 100644 --- a/ly/graphviz-init.ly +++ b/ly/graphviz-init.ly @@ -2,6 +2,8 @@ #(use-modules (scm graphviz)) +#(use-modules (ice-9 regex)) + #(define last-grob-action '()) #(define sym-blacklist '()) @@ -55,9 +57,13 @@ #(define (grob-mod grob file line func prop val) (let* ((val-str (truncate-value val)) - (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob::name grob) file line prop val-str))) + (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob::name grob) file line prop val-str)) + ;; to keep escaped "\"" we need to transform it to "\\\"" + ;; otherwise the final pdf-creation will break + (escaped-label + (regexp-substitute/global #f "\"" label 'pre "\\\"" 'post))) (if (relevant? grob file line prop) - (grob-event-node grob label file)))) + (grob-event-node grob escaped-label file)))) #(define (grob-cache grob prop callback value) (let* ((val-str (truncate-value value)) |