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

error: [object SourceAnnotation] on Windows #23

Closed
taylor1791 opened this issue Dec 1, 2014 · 5 comments
Closed

error: [object SourceAnnotation] on Windows #23

taylor1791 opened this issue Dec 1, 2014 · 5 comments

Comments

@taylor1791
Copy link

On two different windows boxes

$ npm install -g api-mock
$ api-mock my\test\api.md
info:    Enabled Cross-Origin-Resource-Sharing (CORS)
info:           Allow-Origin: *
info:           Allow-Methods: GET, PUT, POST, PATCH, DELETE, TRACE, OPTIONS
info:           Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization, Referer, Prefer
info:    Listening on port 3000
error:   [object SourceAnnotation]
undefined

Any ideas?

@taylor1791
Copy link
Author

If the API blueprint has carriage returns, it breaks in protagonist.

@ecordell
Copy link
Contributor

ecordell commented Dec 2, 2014

Thanks for making a note of that!

api-mock uses protagonist to parse, which in turn uses snowcrash. The carriage returns are actually enforced in the C parser itself.

@zation
Copy link

zation commented Dec 3, 2014

@taylor1791 I got the same error as yours. Can you please let me know what do you mean by carriage? And how you fix this problem?
Thanks!

@ecordell
Copy link
Contributor

ecordell commented Dec 3, 2014

@zation A carriage return is a control character (see: http://en.wikipedia.org/wiki/Carriage_return). On unixy systems, a new line is specified with just a newline character (\n in C-style escaping), but on windows it's often a new line + a carriage return (\n\r).

A lot of text editors have options for converting between the two styles. If your editor's find-replace supports escaping, you can even just replace \n\r with \n and call it a day.

@zation
Copy link

zation commented Dec 4, 2014

@ecordell thanks a lot! But I found my problem is not about the carriage return, it's because the spaces length for a tab is not standard...

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

3 participants