Render markdown for snippets if links contain hash to anchor

What does this MR do and why?

Links to markdown snippets did not render the markdown if the link contained a hash. This MR modifies the logic to render the markdown if there is a hash that does not start with #LC (which is used to link and highlight lines in the source code).

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Create a snippet with some markdown headers
  2. Visit the snippet directly and observe markdown renders
  3. Link to a specific header
  4. Visit URL with linked header in a new tab
  5. Observe that the markdown no longer renders

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #375182 (closed)

Merge request reports

Loading