Newline sometimes prints extra char

App version

Beta

Issue description

This has been an issue for ages but I couldn’t figure the cause and I found a workaround, so I forgot about it. Ran into it again while working on another theme, so here we are.

Under the following conditions:

  1. Custom string has 2+ lines
  2. output of string ends with \n
  3. the blank line created exceeds the selected “line count”

the app will print an extra character at the end of the last visible line. This extra character causes text on that line to be misaligned and clipped by the text box. (This extra character may not be visible but it still affects alignment.)

Device type

Phone

Media provider

All

Steps to reproduce

Demo NPS: nps-Newline Tester-20260619_233914-symfonium.json (37.9 KB)

Custom string of the format:

1\n2\n

With line count set to be one less than the number of lines in the string. (E.g. the three-line string above should be set to a max line count of two.

Most easily noticed when string’s horizontal alignment is set to Right.

Additional information

No extra character is printed when using %lb% instead of \n, so the issue is specifically with \n usage.

Pic 1: ChromeOS displays a ⌧ for this extra character. (If not for this, I never would’ve figured out the problem.)

The top two pairs have the same text but the first pair uses \n while the second pair uses %lb%. The first pair clearly cuts off the start.

Pic 2: On my Phone, extra character is not visible but still affects alignment. (Horizontal margins are set to zero.)

Pic 3: a more normal scenario. My workaround was to just enable an overlay (as seen at bottom) to prevent the text clipping. But I see now that the alignment is still off due to the extra character.

Screenshots

I searched existing issues first

on

I understand that logs are mandatory

on

Log upload name / description

Celorien_Newline

Additional context: I use this to force a minimum two-line spacing when there is only one line of content.

This lets me use have the benefits of “Always 2” line count while still being able to use “Toggle bool” to hide the string.

You are abusing an hack :slight_smile: I’ll have both work like LB for consistency but the trailing \n will no more work.

To clarify, I assume trailing LB will also not work?

I’ll have to figure out a normal way of handling that string now :laughing:

It already does not work, I’m just being consistent.