Suppose, now, that you would use two different output mechanisms for
subscribers. One, say, through Javascript, and one in a different
output format. Then these should be escaped differently. This escaping
must be done in the library that outputs the data: The string stored
inside the text attribute of the class must contain the literal
message, not the escaped message. Hence, when inputting data as a
controller, you should use the "Meteor Input Format" while when Meteor
is outputting, it should be using the "JS Output Format" or whatever
output format. The point is that, exactly because you want to have
support for different outputs, the message stored in the class
attribute must not be escaped prior to outputting it. Any escaping
done by the controller must be simply so that Meteor is able to
interpret the literal incoming message i.e. \n could mean a literal
new line.
The same way that a PHP programmer should be mysql_escape_real_string
prior to performing a database query, Meteor should call an addslashes
method before outputting data to Javascript. Then again, the
controller must also send the data in a way that Meteor understands
i.e. no new lines within message texts unless they are encoded using
some mechanism (which can be different from what you use in your
output format).
In general, the input and the output format should be disjoint as
there can be different outputting mechanisms. For being able to write
an extensible client, the same input should be able to be used in any
of the output formats to produce the same literal text.
Regards,
Dionysis Zindros,
Kamibu Development Group.
On Mar 10, 10:26 pm, "
eksterg...@gmail.com" <
eksterg...@gmail.com>
wrote: