Preventing unwanted HTML line breaks / forcing line breaks in Word

Hello,

I have two specific questions regarding handling line breaks:

1. HTML text starts on a new line (unwanted)

I am passing HTML content into a template. The expected behavior is inline rendering, but the HTML content always starts on a new line.

Token:
Text {{#html Kategorie.Besprechungspunkt.Unterpunkt.Textblock.TextFormattedNOST}}

HTML content:
"<p style=\"margin: 0; margin-bottom: 0;\">WAX explains the structure and content ..</p>"

Result in a table cell:

Text
WAX explains the structure and content ..

Desired result:

Text WAX explains the structure and content ..

Question:
How can I achieve this behavior, or what needs to be changed in the HTML code to make the content render inline?


2. Conditional line break in Word (field/formula logic)

I want to insert a controlled line break within dynamically generated text, depending on a condition.

Something like:

{{#if Kategorie.Besprechungspunkt.Unterpunkt.ErledigtInBesprechung != null}}%InsertLineBreak%{{#else}}{{/if}}

Question:
Does anyone have an idea how to implement this properly in Word (e.g., via field codes, templates, or similar mechanisms)?

Thanks in advance.

Hello @t.porstein ,

  1. When using {{#html}}, the content is always inserted as a separate block, not inline with existing text.

This happens because both Word and Excel do not support inserting HTML directly inside an existing line of text. Instead, the HTML is converted and added as a separate element (like a new paragraph in Word or a separate content block in Excel).

If you need the content to stay in the same line, we recommend using a regular token like {{textData}} and passing plain text instead of HTML. You can then apply the desired formatting directly in the Word template.

Template example:

JSON data:

{"textData": "WAX explains the structure and content"}

The result:

If you have another reason or scenario, please describe it so I can help you properly.
If you have a different scenario or requirement, please feel free to describe it, so I can help you properly.

  1. Regarding the Conditional line break in Word, could you please provide an example of how it should work and look?

If you need to hide certain text, you can use the hide-if operator. Please refer to the following article: Logical operation hide-if

Best regards,
Aleksandra
Plumsail team