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

Issue with building lunr indexes on windows #28

Open
gsherman opened this issue Sep 3, 2013 · 0 comments
Open

Issue with building lunr indexes on windows #28

gsherman opened this issue Sep 3, 2013 · 0 comments

Comments

@gsherman
Copy link

gsherman commented Sep 3, 2013

I ran into an issue when creating the index for lunr's search.

Chrome's console would show:
Uncaught SyntaxError: Unexpected token ILLEGAL in lunr-index.js

It's because of the multi-line text within the content.
In lunr-index.js, I can see it's replacing newlines with spaces:

body: "<%= section.markdown.replace(/\n/g, " ").replace(/"/g, '\\"') %>"

But that didn't work on Windows.
I replaced it with:

 body: "<%= section.markdown.replace(/(\r\n|\n|\r)/g, " ").replace(/"/g, '\\"') %>"

and that 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

1 participant