Fix diff of requirements.txt file by not matching newlines as part of package names
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/34321
The cause of the problem was that each newline that followed a package name would have an <a>
tag around it in the blob content, which meant that when splitting the blob content up into lines, some lines would end in the opening <a>
tag, and others would start in the closing </a>
tag. When then rendering each line in its own <td>
for the diff, the <td>
would hold invalid content (half an <a>
tag).
Note that there is no XSS issue here: the displayed HTML is all GitLab generated.
Before:
After: