I have problem with Meteor helper variable in template.
<div id="window"> {{ string }} </div>
CSS:
#window {
height: 450px;
overflow: auto;
word-wrap: break-word;
white-space: pre-wrap;
}
I am reading text from file.
If I set the helper variable in JavaScript like:
Template.oreo.helpers({
string: function() {
return 'Here is sentence. After which is spaces that is being replaced by one. '
}
});
The multiple string will be replaced by one single space..
Bet when I set the text using JQuery:
$('#window').text('Here is multiple spaces.');
This problem does not occur.
How can I fix this? It is really important to save the text in helper string or I will have to rewrite all of my script.
Are you sure you aren't accidentally trimming the string before displaying it in browser?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With