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

Bug: Carriage return causes infinite loop #195

Closed
kiwiroy opened this issue Jul 6, 2016 · 2 comments
Closed

Bug: Carriage return causes infinite loop #195

kiwiroy opened this issue Jul 6, 2016 · 2 comments
Labels
👀 no/external This makes more sense somewhere else 🐛 type/bug This is a problem

Comments

@kiwiroy
Copy link

kiwiroy commented Jul 6, 2016

See gist for example.

npm install
npm test

README.md and example-good.md should be fine, example-bad.md is bad

Removing either .remarkrc or example-bad.md allows the test to pass. As does an in-place edit with perl.

perl -i -lne 's/\r//g; print' example-bad.md
@wooorm
Copy link
Member

wooorm commented Jul 6, 2016

So, there’s two parts to this issue:

  1. remark-lint enters infinite loop; I’ll push a fix for this;
  2. Carriage returns are not supported. Fix being to strip them before passing to remark (most editors do that by default or are configurable to do it). Long term fix is to allow carriage returns everywhere where newlines are also possible in the parser, instead of removing them in a preprocessing step. The latter will be a lot of work and I’m not really interested in doing that. But if you’d like to take a stab, I’d gladly merge a PR!

@wooorm wooorm added 🐛 type/bug This is a problem 👀 no/external This makes more sense somewhere else labels Jul 6, 2016
@wooorm
Copy link
Member

wooorm commented Jul 6, 2016

I’ll use this issue to refer to the first, if you’re interested in the second, could you open a new issue?

@wooorm wooorm changed the title \r characters in files cause high CPU usage - possible infinite loop. Bug: Carriage return causes infinite loop Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants