When I use the text with the text \ r \ n (Carriage Returns - Newline), text Is improperly formatted [update: \ r \ nA textorte is generated after filling, I'm simply dragging from the database that was previously loaded. Also to note, I do not have this problem in the production environment. END UPDATE] For example:
% textarea = "Hello \ r \ n How are you?"
Comes out like this:
Hello how are you?
I am thinking that there can be something with HAML on what can someone help me? Note: If I use \ n \ r then it works fine, but it is technically incorrect and the id has to be done to reverse some compartments for proper performance.
Because attacks automatically trigger HTML source code, such as whitespace-sensitive tags such as Prescasonia and Whatsyas Content may be poor HTML Nullin organizations & amp; # X000A; With these tags, there is a solution to change the new lines, which uses the Himal code
helpers
Generally, when you are using a tag, you will automatically do this for you (it can be customized using : Protect
the option). For example,
% p% textarea = "foo \ nbar"
will be compiled
Lt; P & gt; & Lt; Text area & gt; Foo & amp; # X000A; Bar & lt; / Text field & gt; & Lt; / P & gt; However, if someone is building a helpful tag, hemat can not recognize it and therefore you have to call Haml :: helpers # find_and_preserve
. You can also use ~
, which is similar to =
, apart from it automatically runs find_and_preserve
on your input. To: % p = find_and_preserve "texturea> fu \ n bert "
is identical
% p ~ "textarea> fu \ n bert
and renders
& lt; P & gt; & Lt; Textarea & gt; Fu & # x000a; Bar & lt; / Textarea & gt; & Lt; / P & gt;
Source :.
Comments
Post a Comment