Problem in passing data to HTML template


#1

When i’m passing data in an HTML5 template I have the following problem.
I create a key (e.g. f0), I type some text in value and it works fine.
If i press Enter in the value field it doesn’t work and it loads the default text from the template.


#2

This is happening because Enter (new line) or <br> is not being handled in casparcg.js script. When this is encountered in casparcg it breaks the command and error occurs. So default data appears.

.


#3

Is there any way to solve it?


#4

You can do like this
Untitled


#5

Thank you very much.
Can i also send a line break to the template?
Becuase in that way it displays all text in one line (e.g. vimlesh kumar Tanti).


#6

You need to modify the casparcg.js like below. Note that you need to remove “escapeHtml” function

    function dataInsert(dataCaspar) {
    for (var idCaspar in dataCaspar) {
    var idTemplate = document.getElementById(idCaspar);
    if (idTemplate != undefined) {
   //idTemplate.innerHTML = escapeHtml(dataCaspar[idCaspar]);
    idTemplate.innerHTML = (dataCaspar[idCaspar]);
     }
     }
     }

And then type the values like below.

Untitled