-
Notifications
You must be signed in to change notification settings - Fork 52
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
MarkDown markup visible on documentation search page #3575
Comments
I was looking into this issue. headline = SearchHeadline("content", query) This function acts on the database where it runs the postgresql ts_headline function. The first argument is either the column name or a database expression applied to the column (using Therefore, the In this case, the md = ("bold**: "
"more text more text more text. here is the link (defined by [woooow](https://www.google.com")
html = render_markdown(md or "")
soup = BeautifulSoup(html, features='html.parser')
# Output: bold**: more text more text more text. here is the link (defined by [woooow](https://www.google.com Ideally, we want the content to be in plain text (e.g. by rendering the markdown to html and then extracting the text using I can think of these solutions currently: 1- remove the markdown characters from the text (with regex). That will require handling quite some cases to make sure it is clean (images, links, quotes, code blocks, typography ..etc). |
Why is this not possible? I would have thought that you can annotate the queryset with a new |
According to documentation, annotations are for database expressions and not python functions. So, I can't pass a python function on a column for annotation. I tried that also. Regarding SearchHeadline() , the first argument is either the column name or a database expression applied to the column. It does not take a query string as input, so can't act on annotated column in query string That's why I mentioned in one suggestion that the plain text extraction probably should happen in python after getting the relevant results and doing the highlight afterwards. |
I'm not sure, but I think you can write your own database expression using Func() (and then maybe the |
After discussing the proposed options above with Anne synchronously, and in the light of the discussion on #3740, the latest suggestion would be to leave out the headline from the search results and only show the title of the doc page (no server side headline search and highlight). Can you @jmsmkn give feedback on this please? |
Yes just remove the Headline search, do not implement keyword highlighting or try to fix #3740. |
closes #3575 ![Screenshot 2024-12-16 at 15 19 36](https://github.com/user-attachments/assets/68f46dd5-f8ec-4099-9c24-9971348e75c4)
This should only show the content, not the markup:
The text was updated successfully, but these errors were encountered: