brainbuz / form-diva

Form::Diva Form Elements Generator
3 stars 2 forks source link

Whitespace-sensitive input content gets distorted #10

Closed bbrtj closed 2 years ago

bbrtj commented 2 years ago

Diva.pm, line 207: $input =~ s/\s+/ /g; # remove extra whitespace.

This is done after value is inserted into the string. Because of that, text that has significant whitespace can't be used through diva (for example in textareas: newlines are transformed into spaces, so the entire thing becomes single line)

bbrtj commented 2 years ago

Closing: fixed in efb9936

bbrtj commented 2 years ago

Sadly, still an issue, but in different cases.

Seems like whitespace cleaning was done twice - once in _input method (which got removed), and again in generate method (after calling _input). The second one is in form of s/ +/ /g, so it does not remove newlines.

Still, can't use Diva + textarea with something like source code, the indentation will be messed up completely.