Added support for links to markdown file code lines
What does this MR do and why?
Related to #15036 (closed).
I, @leetickett and @espadav8 worked on this MR during one of our pairing sessions.
This MR tries to solve the problem described in the related issue, where URLs that point to a code line of a markdown file won't get actually handled because the markdown file is getting rendered.
Screenshots or screen recordings
README.md___master___Flightjs___Flight___GitLab_-Personale-_Microsoft__Edge_2022-07-05_17-53-38
How to set up and validate locally
There are a couple of things to check:
- the
plain
value on the URL is getting used- Go to a project with markdown file, e.g. the
Flight
project - Open a markdown file, e.g.
README.md
- Switching from rich view to code-behind will add/update the
plain
element on the query string of the URL - Copying the URL with the
plain
value set to1
and pasting it on a new tab should show the code behind of the markdown file, not the rich view - Copying the URL with the
plain
value set to0
and pasting it on a new tab should show the rich view - When a file does not have a rich view, the
plain
value is ignored
- Go to a project with markdown file, e.g. the
- an URL to a markdown file code line and the
plain
value set to1
should highlight and scroll to the selected line- Go to a project with markdown file, e.g. the
Flight
project - Open a markdown file, e.g.
README.md
- Switch to the code-behind view
- Get a permalink to a code line
- Copy the URL to a new tab
- The file should get rendered showing its code-behind and highlight and scroll to the selected line
- Go to a project with markdown file, e.g. the
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marco Zille