hubs icon indicating copy to clipboard operation
hubs copied to clipboard

Allow newlines in troika-text

Open wmurphyrd opened this issue 2 years ago • 2 comments

With the switch to troika text, we lost processing of newline characters in text values. Screenshot from 2022-06-17 14-07-43

Troika's docs said they support them, so I took a peek at their source and found this little preprocessing on the text value was not present in the hubs version.

Screenshot from 2022-06-17 14-24-53

wmurphyrd avatar Jun 17 '22 19:06 wmurphyrd

Ah interesting, I wonder why the string is ending up with a literal ['\' 'n'] instead of a newline character. I guess you just cant type actual newlines in to the HTML (would probably work via setAttribute. Could try 
. In anycase this change seems sane enough.

netpro2k avatar Jun 20 '22 21:06 netpro2k

@netpro2k oh yeah I should have specified it's not literal new lines, but <a-entity text="value: line 1\nline 2"></a-entity> that is affected

wmurphyrd avatar Jun 20 '22 21:06 wmurphyrd

This looks ok to me, @netpro2k do you see any issues with pulling this in?

matthewbcool avatar Dec 22 '22 16:12 matthewbcool

@matthewbcool thanks for following up. I expect this PR is obsolete with the refactor away from A-Frame underway

wmurphyrd avatar Feb 16 '23 15:02 wmurphyrd