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

Fixed search page-id edgecase #630

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

corvin-koegler
Copy link

Adding a space to numeric searches prevents markdown from breaking the search.

Issue 612

@frcroth
Copy link
Contributor

frcroth commented Oct 22, 2024

Can you explain why this happens?

@lukasrad02
Copy link
Contributor

This only fixes the symptom, but not the actual root cause.

The underlying problem of #612 is that the highlighting logic replaces substrings in the markdown text. So, for example, searching for "page" also breaks our internal links (in the form of [Text](page:123)). This query does not cause a internal server error, as the markdown renderer just uses **page**:123 as link target, but it still alters the meaning.

Hence, we either have to use a more sophisticated highlighting logic (parsing the markdown into an AST, then performing replacements only on textnodes and then writing the AST back to markdown), or have to remove the highlighting completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants