Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support multi line form values #13

Open
lbittner-pdftron opened this issue Apr 18, 2018 · 3 comments
Open

Does not support multi line form values #13

lbittner-pdftron opened this issue Apr 18, 2018 · 3 comments

Comments

@lbittner-pdftron
Copy link

lbittner-pdftron commented Apr 18, 2018

Issue

When submitting a form with a multiline value such as:

Test line one,

Test Line Two

Anything after 'Test line one' gets removed.

After some debugging I figured out that this code (line 50 as of now):

.split(/\r\n\r\n/)[1]

is the issue. The input of the sample text above looks like so:

\r\n\r\nTest line one,\r\n\r\nTest Line Two\r\n

And the split() call is only taking the first element in the array, which is Test line one,.

Quick solution

For now, I just changed that line to this:

.split(/\r\n\r\n/).slice(1).join("\r\n")

Keep in mind that this changes any amount of new lines to a single new line. I don't have time to create a PR, but you could do something similar to support multi line inputs.

@tmadej
Copy link

tmadej commented Apr 19, 2018

I'm experiencing the same issue.

Adding the quick solution above to line 50 seem to have resolved it. I suspect that line 38 requires a similar fix.

phodal added a commit to phodal/wecode that referenced this issue May 9, 2018
@sergolius
Copy link

@zcmgyu
Copy link

zcmgyu commented Jan 17, 2019

@sergolius Thanks. Your fork works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants