ingydotnet / swim-pm

15 stars 7 forks source link

kwim parser fails to parse files with no trailing newline #5

Closed nikolawannabe closed 10 years ago

nikolawannabe commented 10 years ago

This should be allowed as it is a common use case.

pdl commented 10 years ago

As far as I can see, it works fine. I've tried:

echo -e "foo\n\n* bar" | bin/kwim --to=html

...and I get a p followed by a ul, all well-formed. An extra \n doesn't make any difference.

I've also tried it with a file with no trailing new line.

Could you give a minimal test case?

ingydotnet commented 10 years ago

@pdl, echo adds a newline.

Try:

echo -n foo | ./bin/kwim

PS. I'm on IRC if you've got time.

pdl commented 10 years ago

Ah, of course it does! I tried it with a plain file with no line endings and it seemed fine, but perhaps I had left a trailing line by accident. Yes, with -n I can reproduce it.

ingydotnet commented 10 years ago

Fixed in 9852b8c79ae4b2a8e4a0a76a057e2bc42fbb191a