How to write multiline text in automation

I wrote this automation to export a string like this

pippo#25#pluto36

into my log file.
It works perfectly, but since the original string is actually much longer, I would need to break it without inserting spaces.
This is the code of the given automation:

> text: >-
>     goofy"{{states('sensor.iphone13_battery_level')}}"pluto"{{states('sensor.energyapp_energy_power')}}"paperino"{{states('sensor.energyapp_energy_today')}}"
>   mode: single
> action: shell_command.log

A bit unclear to me what it is you want to do.

Insert linebreaks into the log message without inserting a linebreak? Don’t quite see how that would work. There are Unicode characters for “soft linebreaks” but no idea how widely supported they are in various viewers etc.

Insert linebreaks into the code/template without inserting linebreaks into its rendered output? You can use as much or as little whitespace within the Jinja markup/tags as you want, or you can add a dash to the beginning and/or end of a tag ({{-, -}}, {%-, -%}, {#- or -#}) to consume surrounding whitespace in the tag’s direction. See Whitespace Control in the documentation.

https://jinja.palletsprojects.com/en/stable/templates/#whitespace-control

Try using two line breaks like this (and don’t quote your mult-line templates):

 text: >
    goofy {{ states('sensor.iphone13_battery_level') }}
    
    pluto {{ states('sensor.energyapp_energy_power') }}
    
    paperino {{ states('sensor.energyapp_energy_today') }}