nim-lang / nimforum

Lightweight alternative to Discourse written in Nim
https://forum.nim-lang.org/
MIT License
764 stars 70 forks source link

Feature/#331 formatting of codeblock comments in search breaks #341

Open PhilippMDoerner opened 1 year ago

PhilippMDoerner commented 1 year ago

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.

2) also takes care of some HTML rendering problems: Broken example: image

Now with the fixes applied: image

jyapayne commented 1 year ago

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