image for site

Trimming White Space in Curlybars Templates

Learn how to use the tilde character in Curlybars templates to trim white space and maintain clean HTML output in Zendesk Help Center.

How do I trim white space in Curlybars templates?

Curlybars allows you to trim white space around expressions using the tilde character~. This helps control the spacing in your rendered HTML.

By placing a tilde in the opening or closing curly brackets, you can remove unwanted spaces. For example,{{#if highlighted~}} highlight {{~/if}}trims spaces around 'highlight'. This feature is useful for maintaining clean and precise HTML output.


More related questions

What is the Zendesk Help Center templating language?

The Zendesk Help Center uses a templating language called Curlybars, which is similar to Handlebars. Curlybars allows you to customize the layout and content of your Help Center pages by using a mix of HTML and templating expressions. Curlybars…

How do I add comments in Curlybars templates?

In Curlybars, you can add comments to your templates to include notes that won't appear in the rendered page. This is useful for documentation or debugging purposes. To add a comment, use the syntax{{! ... }}for single-line comments. For…

What are literals in Curlybars and how are they used?

Literals in Curlybars are values that are interpreted exactly as written, and they can be strings, booleans, or numbers. This allows you to include static data in your templates. Strings can be enclosed in single or double quotes, booleans are…

How can I use conditionals in Curlybars templates?

Curlybars allows you to use conditionals to control the rendering of content based on certain conditions. This is useful for displaying different content based on the data available. You can use{{#if condition}} ... {{/if}}to render content if…

What are helpers in Curlybars and how do they work?

Helpers in Curlybars are functions that provide additional functionality to your templates, such as formatting data or performing operations. For example, theexcerpthelper can truncate a string to a specified number of characters. You can…

How do I access items in an array using Curlybars?

To access items in an array in Curlybars, you use theeachhelper, which iterates over each item in the array and allows you to render content for each one. For example, if you have an array of attachments, you can use `{{#each attachments}} ……

How can I change the scope in Curlybars templates?

In Curlybars, you can change the scope using thewithconstruct, which allows you to set a new base context for a block of code. This is useful for simplifying long property paths. For example, using{{#with article.author}} ... {{/with}}lets…

Interested indeflectingover 70% of your Zendesk support tickets?

Our AI customer support agent is here to help. Trained on all your help docs, installed directly into your Zendesk account, it can be used to automate customer replies for tickets or live chat. Learn more below.
Zendesk logo

Zendesk Support Tickets

Receive new tickets by email or a support form? This integration is for you.
My AskAI integrated within Zendesk to deflect support tickets
Learn about our Zendesk ticket integration
Zendesk logo

Zendesk Messaging (live chat)

Using Zendesk's Messaging widget on your site for live chat? This integration is for you.
My AskAI integrated within Zendesk to deflect customer support live chat conversations
Learn about our Zendesk Messaging integration

Join1,000+ companies reducing their support costs and freeing up support agents for more important work

Vestd company logo — Customer of My AskAI's AI customer support agents
Genesis company logo — Customer of My AskAI's AI customer support agents
Zinc company logo — Customer of My AskAI's AI customer support agents
Customer.io company logo — Customer of My AskAI's AI customer support agents
Zeffy company logo — Customer of My AskAI's AI customer support agents
NHS company logo — Customer of My AskAI's AI customer support agents
Kontakt.io company logo — Customer of My AskAI's AI customer support agents

Reduce support costs.Spend more time on customer success.

Our AI customer support agents are already used by 👇
Companies using AI assistants on their websites