diff --git a/patacrep/data/templates/songs/chordpro/chordpro/song_header b/patacrep/data/templates/songs/chordpro/chordpro/song_header index fe9feb48..e73da259 100644 --- a/patacrep/data/templates/songs/chordpro/chordpro/song_header +++ b/patacrep/data/templates/songs/chordpro/chordpro/song_header @@ -33,6 +33,10 @@ {key: (( key.keyword )): (( key.argument|escape_specials('{}\\') ))} (* endfor *) +(*- if 'url' in metadata -*) + {url: (( metadata.url ))} +(* endif -*) + (*- for chord in metadata['define'] *) ((- render(chord) )) (* endfor *) diff --git a/patacrep/data/templates/songs/chordpro/latex/song b/patacrep/data/templates/songs/chordpro/latex/song index d2cbe830..2830fc34 100644 --- a/patacrep/data/templates/songs/chordpro/latex/song +++ b/patacrep/data/templates/songs/chordpro/latex/song @@ -27,6 +27,9 @@ (( key ))={(( metadata[key]|escape_specials('{}&#_^%~$\\') ))}, (* endif *) (* endfor *) + (* if 'url' in metadata *) + url={(( metadata.url|escape_specials('%#') ))}, + (* endif *) (* if 'cover' in metadata *) (* block cover *) (* set cover = metadata["cover"].argument|search_image|path2posix *) diff --git a/test/test_song/special.csg b/test/test_song/special.csg index ea9460d8..59b8d817 100644 --- a/test/test_song/special.csg +++ b/test/test_song/special.csg @@ -2,7 +2,7 @@ {title: & $ % # _ \} \{ ~ ^ \\} {artist: & $ % # _ \} \{ ~ ^ \\} {album: & $ % # _ \} \{ ~ ^ \\} -{url: & $ % # _ \} \{ ~ ^ \\} +{url: http://&$%#_~^} & $ % \# _ \} \{ ~ ^ \\ diff --git a/test/test_song/special.csg.source b/test/test_song/special.csg.source index cb8d7c9d..f5874022 100644 --- a/test/test_song/special.csg.source +++ b/test/test_song/special.csg.source @@ -1,7 +1,7 @@ {title: & $ % # _ \} \{ ~ ^ \\} {artist: & $ % # _ \} \{ ~ ^ \\} {album: & $ % # _ \} \{ ~ ^ \\} -{url: & $ % # _ \} \{ ~ ^ \\} +{url: http://&$%#_~^} & $ % \# _ \} \{ ~ ^ \\ diff --git a/test/test_song/special.tsg b/test/test_song/special.tsg index aa42a9cc..a7b232bb 100644 --- a/test/test_song/special.tsg +++ b/test/test_song/special.tsg @@ -4,6 +4,7 @@ by={ \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} }, album={\& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{}}, + url={http://&$\%\#_~^}, ]