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

Fix get pages regular expression #251

Merged
merged 1 commit into from
Feb 18, 2021
Merged

Fix get pages regular expression #251

merged 1 commit into from
Feb 18, 2021

Conversation

McCaulay
Copy link
Contributor

A 500 error occurs when searching with the internal engine if you have brackets inside sidebar text.

Example:

- ## Example
    - [80 / 443 HTTP(S)](/{{route}}/{{version}}/example/http)

This causes the $page parameter to contain "S" in this scenario instead of "/{{route}}/{{version}}/example/http". To prevent the error, I have added a validation check on the explode array to make sure it contains more than 1 element.

To fix the issue itself, i've updated the regular expression from \(([^)]+)\) to \[.+\]\((.+)\). This expects a [something] before the brackets (url) which I believe should always exist for a valid markdown link.

@saleem-hadad saleem-hadad merged commit a3833e3 into saleem-hadad:master Feb 18, 2021
@saleem-hadad
Copy link
Owner

Thank you for your help @McCaulay!

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

Successfully merging this pull request may close these issues.

None yet

2 participants