I created a multi-line meta field but it shows single line text

My code:

{%- liquid
assign desc = product.description
assign fontsize_text = block.settings.fontsize_text
assign color_text = block.settings.color_text
assign word_number = block.settings.word_number
-%}
{% if product.metafields.c_f.short_description %}
{%- liquid
assign desc = product.metafields.c_f.short_description
-%}
{% endif %}
{%- if desc != blank -%}

{{ desc | strip_html | truncatewords: word_number }}
{%- endif -%}

How can I edit the code to make the words separated.

Anyone can help? Thanks.

Hello, @Vizono

Greetings from the Wholesale Helper Support Team! Happy to help you today.

Copy the below code and paste it instead of the above code:

{%- liquid
assign desc = product.description
assign fontsize_text = block.settings.fontsize_text
assign color_text = block.settings.color_text
assign word_number = block.settings.word_number
-%}

{% if product.metafields.c_f.short_description %}
  {%- liquid
  assign desc = product.metafields.c_f.short_description
  -%}
{% endif %}

{%- if desc != blank -%}
  
    {{ desc | strip_html | split: ' ' | join: ' ' }}
  

{%- endif -%}

In this updated code, the split: ’ ’ filter is used to split the description into an array of words based on spaces, and then the join: ’ ’ filter is used to join these words back together with spaces. This way, the words will be separated in the displayed text.

Let me know If need further assistance

Regards,

Wholesale Helper Support Team