<br/> Appearing at the start of the text after Import from Articy

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
bulka_tarta
Posts: 2
Joined: Thu Oct 12, 2023 3:37 am

<br/> Appearing at the start of the text after Import from Articy

Post by bulka_tarta »

Hi,

I've been using Dialogue System for a while now, but I'm new to the forums!

I have recently been running into a problem, where using pipe (|) in Articy doesn't always import correctly. What I mean is that 90% of the time the pipe in Articy is correctly split into multiple nodes in Dialogues System.

But that other 10% seems to add <br/> at the beginning of the text.

Example:
In Articy:
Image
In Game:
Image

There are instances where text in Articy is longer and has multiple pipes - and some of them are split correctly, while some are split with the <br/>. It seems random to me and what seems to fix it sometimes is going back to Articy, deleting the pipe and adding it again. It's really hard to catch all instance like this, since in Articy it all looks the same.

Is there something I'm missing? Any pointers in the right direction are greatly appreciated!

Dialogue System v: 2.2.39
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: <br/> Appearing at the start of the text after Import from Articy

Post by Tony Li »

Hi,

Can you try DS version 2.2.40.2?

I'm testing with articy:draft 3.2.2 and DS 2.2.40.2, with this dialogue fragment:

softBreakArticy.png
softBreakArticy.png (10.35 KiB) Viewed 649 times

In articy, "Export markup for text formatting?" is ticked.

The exported XML contains this:

Code: Select all

<LocalizedString Lang=""><![CDATA[<html><head><style>#s0 {text-align:left;} #s1 {font-size:11pt;} </style></head><body><p id="s0"><span id="s1">Foo|</span><br/><span id="s1">Bar</span></p></body></html>]]></LocalizedString>
The imported conversation in Unity does not contain "<br/>". It does, however, contain a line break:

lineBreakBar.png
lineBreakBar.png (6.67 KiB) Viewed 649 times

I can make adjustments to remove that line break. But let's first make sure the <br/> issue is resolved.
bulka_tarta
Posts: 2
Joined: Thu Oct 12, 2023 3:37 am

Re: <br/> Appearing at the start of the text after Import from Articy

Post by bulka_tarta »

Hi, thanks for getting back to me on this!

We've updated to the latest DS, but still got the <br> tag.
We realised that the tag wasn't being added to ArticyTools.cs

So added the <br/> and now it seems to work!

Code: Select all

private static string[] htmlTags = new string[] { "<html>", "<head>", "<style>", "#s0", "{text-align:left;}", "#s1",
    "{font-size:11pt;}", "</style>", "</head>", "<body>", "<p id=\"s0\">", "<span id=\"s1\">",
    "</span>", "</p>", "</body>", "</html>", "<br/>" };
Not sure why it was missing and if it needs to be added to the future DS updates?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: <br/> Appearing at the start of the text after Import from Articy

Post by Tony Li »

Hi,

Some people will want to keep "<br>" in their text.

I'll make sure it's translated into a newline character during import and also add an option to remove them when splitting text on pipe characters.

I'll try to have a patch ready by the end of the weekend, sooner if possible.
brave_chris
Posts: 5
Joined: Tue Dec 06, 2022 5:38 am

Re: <br/> Appearing at the start of the text after Import from Articy

Post by brave_chris »

Hi Tony, will the patch also remove new lines after pipes using the enter key without shift as well?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: <br/> Appearing at the start of the text after Import from Articy

Post by Tony Li »

Yes. I'll add a checkbox to remove <br>/newlines around pipes. It'll be ticked by default.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: <br/> Appearing at the start of the text after Import from Articy

Post by Tony Li »

This patch should fix the issue, too:

DS_ArticyPatch_2023-10-14.unitypackage

It adds a Trim Whitespace checkbox. The checkbox is ticked by default, so you shouldn't need to do anything extra.
brave_chris
Posts: 5
Joined: Tue Dec 06, 2022 5:38 am

Re: <br/> Appearing at the start of the text after Import from Articy

Post by brave_chris »

It's all looking good now, thank you so much Tony!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: <br/> Appearing at the start of the text after Import from Articy

Post by Tony Li »

Happy to help! Thanks for the suggestion.
Post Reply