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

Search functionality breaks when round brackets "()" are used in the link name #262

Open
parthjani7 opened this issue Mar 14, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@parthjani7
Copy link

parthjani7 commented Mar 14, 2021

I am using round brackets ( ) in the link name, i.e. - The Link (example).

The following line grabs everything from the round bracket and generates an array of links from index.md page, at that time it also collects substrings from the link name, when round brackets are used in the title.

preg_match_all('/\(([^)]+)\)/', $this->files->get($path), $matches);

When search functionality gets called, clicking on the search icon, it comes down to the following line:
explode("{{version}}", $page)[1];

at that point it breaks, because the above-mentioned regex in the getPages() has already collected example from the link name and explode cannot find {{version}}

Regex needs to be modified to ignore everything between [ ] which would be link name in the index.md

@saleem-hadad saleem-hadad added the bug Something isn't working label Mar 22, 2021
@saleem-hadad
Copy link
Owner

Thanks @parthjani7 for submitting this. WIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants