Commit graph

10 commits

Author SHA1 Message Date
GitLab Bot
be3e24ea3c Add latest changes from gitlab-org/gitlab@master 2020-01-22 12:08:40 +00:00
Patrick Bajao
bf230da05d Support selective highlighting of lines
Instead of highlighting all lines when not all of them
are needed, only highlight from the beginning up to
the specified limit.

The `BlobPresenter#highlight` method has been updated
to support `to` param. This param will be used to limit
the content to be highlighted.
2019-09-02 11:44:45 +08:00
Patrick Bajao
6d318af5f9 Revert "Merge branch '65152-selective-highlight' into 'master'"
This reverts merge request !31361
2019-08-09 00:13:09 +00:00
Patrick Bajao
46631e1023 Support selective highlighting of lines
Instead of highlighting all lines when not all of them are
needed, only highlight specific lines.

The `BlobPresenter#highlight` method has been updated to
support `since` and `to` params. These params will be used to
limit the content to be highlighted.

Modify `Gitlab::Highlight` to support `since` param which will
then be used to determine the starting line number.
2019-08-06 09:32:29 +08:00
Patrick Bajao
866bef8059 Fix suggestion on lines that are not part of an MR
Return the `text` as plain string in the response instead of
including HTML tags but keep `rich_text` as is.

The fix is to modify `Blob::UnfoldPresenter#diff_files` to map
each raw diff line (limited by the range specified) to a
corresponding line in an array of highlighted lines to use as
`rich_text`.
2019-07-22 13:25:24 +08:00
Phil Hughes
522c01972c
Add LFS blob ID to GraphQL blob type 2019-06-10 09:05:44 +01:00
Phil Hughes
4644a2daf5
Add web_url to tree entry in GraphQL API 2019-06-05 08:46:32 +01:00
Mark Chao
623b7f3055 Centralize loading blob data before highlighting 2018-10-30 15:44:55 +08:00
Mark Chao
bc14e4ed10 Move :plain option to Highlight class
This is to DRY the repeated file size check.

Move spec and constants to Highlight
2018-10-30 15:44:55 +08:00
Mark Chao
32f9cf8ce3 Add BlobPresenter for highlighting
Force FoundBlob to use BlobPresenter
2018-10-30 15:44:55 +08:00