How to include line breaks in product custom text field submitted to cart

How to include line breaks in product custom text field submitted to cart

BrinleyW
Shopify Partner
16 1 1

Hi 
(Dawn theme)
I have added a custom text field to a producy details page template using a custom liquid block to capture personalisation details and it works fine apart from the fact that line breaks appear as white spaces in the basket modal as well as on the checkout page. (I assume the same will occur on the order email but havent checked that.)

 

Example of Product page input

BrinleyW_0-1703061364769.png

 

Example of Output

BrinleyW_1-1703061442187.png

For the text field to work I really need the line breaks to be retained. 
I have tried using css white-space: pre-wrap; & white-space: pre-line; on the checkout, basket pages but its a bodge that  doesnt really work.
If anyone knows how to send the form data to include the <br> I would appreciate hearing from you.
Cheers

Brinley   

 

 

Replies 0 (0)