Skip to content

Conversation

@PhilippMDoerner
Copy link
Contributor

@PhilippMDoerner PhilippMDoerner commented Jan 26, 2023

Fixes #331

Fixes overall 2 issues:

  1. ## , # and the like often get rendered into headlines under the right circumstances. By replacing them with \# (which most of the time get rendered to # instead of \# ) you can prevent this from the get-go

  2. Search-hits sometimes get incorrectly boldened. As in, you get rendered **blabla**NoWhitespaceHere, which will lead to the stars being rendered instead of them turning bold. By enforcing in the SQL that "post-snippet" it'll add ** instead of just stars, you can prevent this problem from the start.

  3. also takes care of some HTML rendering problems:
    Broken example:
    image

  • It renders ** instead of making it bold
    -Whitespacing is generally broken
  • ## [ ( )*] r should actually contain this HTML string: ## [<p1> (<p2> <p1>)*]

Now with the fixes applied:
image

When highlighting text with "*" in markdown, it needs space between
the hit enshrined by "**" to get boldened.
This is not always the case.
Therefore we add whitespaces before/after the **
This way we can enforce that it properly gets boldened.

nim-lang#331
Sometimes search-results contain the string `## `.
They do occur as code comments in code-blocks.
If they get recognized, they get turned into headlines.
To avoid this, a replace statement was added.

nim-lang#331
Sometimes search-results contain the string `[`.
They do occur as generics in code-blocks.
If they get recognized, they get turned into links.
To avoid this, a replace statement was added.

nim-lang#331
@jyapayne
Copy link
Collaborator

jyapayne commented Feb 1, 2023

As discussed in #331, please consider removing text formatting altogether. This change somewhat fixes code rendering, but breaks normal markdown rendering.

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.

Formatting of search results is poor

2 participants