Page 1 of 1

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

Posted: Thu Oct 12, 2023 3:58 am
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

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

Posted: Thu Oct 12, 2023 11:16 am
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 578 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 578 times

I can make adjustments to remove that line break. But let's first make sure the <br/> issue is resolved.

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

Posted: Fri Oct 13, 2023 5:11 am
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?

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

Posted: Fri Oct 13, 2023 8:26 am
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.

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

Posted: Fri Oct 13, 2023 8:31 am
by brave_chris
Hi Tony, will the patch also remove new lines after pipes using the enter key without shift as well?

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

Posted: Fri Oct 13, 2023 9:02 am
by Tony Li
Yes. I'll add a checkbox to remove <br>/newlines around pipes. It'll be ticked by default.

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

Posted: Sat Oct 14, 2023 2:18 pm
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.

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

Posted: Mon Oct 16, 2023 6:21 am
by brave_chris
It's all looking good now, thank you so much Tony!

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

Posted: Mon Oct 16, 2023 8:32 am
by Tony Li
Happy to help! Thanks for the suggestion.