Skip to content

Remove `lang` attribute from highlighted lines

Phil Hughes requested to merge ph/removeLangFromHighlightedLines into master

What does this MR do and why?

This attribute is being used incorrectly and is not doing as it was intended to. Instead the files language has been moved to the diff file element instead. The copy as GFM code has been changed to query this diff file element to get the language of the file before copying to clipboard.

For diffs we also remove the un-needed <span class="line" /> element - for the way we render diffs it isn't needed and bloats the payload. For larger commits/merge requests the response should be quicker, I have seen improvements of 5-10% reduction in payload size locally depending on the merge request.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Phil Hughes

Merge request reports

Loading