larecipe
larecipe copied to clipboard
Search functionality breaks when round brackets "()" are used in the link name
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
Thanks @parthjani7 for submitting this. WIP