Open petterw03 opened 2 years ago
If using the textarea field type and json dataformat, newlines are parsed differently depending on if play or update command is used.
Template definition:
window.SPXGCTemplateDefinition = { "description": "Textarea test", "playserver": "OVERLAY", "playchannel": "1", "playlayer": "10", "webplayout": "10", "steps" : "1", "out": "manual", "uicolor": "2", "dataformat": "json", "DataFields": [ { "field": "f0", "ftype": "textarea", "title": "Content", "value": "", }, ], };
Example input:
Value of f0 when using play: Test test test<br>Second line test
Test test test<br>Second line test
Value of f0 when using update: Test test test\nSecond line test
Test test test\nSecond line test
So on play(), the newline is converted to an escaped <br> tag, which seems to be happening here: https://github.com/TuomoKu/SPX-GC/blob/master/routes/routes-application.js#L1359-L1372
<br>
But for some reason, the same is not done on update(). This makes it hard to code template logic that detects newlines.
Yeah, update functionlity is difficult and may need custom logic per template. And as such, update functionality still is problematic on many levels. Will keep this here as a reminder for future updates.
update
If using the textarea field type and json dataformat, newlines are parsed differently depending on if play or update command is used.
Template definition:
Example input:
Value of f0 when using play:
Test test test<br>Second line test
Value of f0 when using update:
Test test test\nSecond line test
So on play(), the newline is converted to an escaped
<br>
tag, which seems to be happening here: https://github.com/TuomoKu/SPX-GC/blob/master/routes/routes-application.js#L1359-L1372But for some reason, the same is not done on update(). This makes it hard to code template logic that detects newlines.