Commit Graph

55 Commits

Author SHA1 Message Date
GitLab Bot ecdd26856c Add latest changes from gitlab-org/gitlab@master 2024-01-02 12:07:21 +00:00
GitLab Bot 9432ed8112 Add latest changes from gitlab-org/gitlab@master 2022-11-03 21:09:24 +00:00
GitLab Bot ec3e75cfea Add latest changes from gitlab-org/gitlab@master 2022-06-15 21:10:04 +00:00
GitLab Bot 93003eb115 Add latest changes from gitlab-org/gitlab@master 2022-03-17 21:08:35 +00:00
GitLab Bot 0fba9a23d0 Add latest changes from gitlab-org/gitlab@master 2021-09-21 21:11:35 +00:00
GitLab Bot 861cc0c363 Add latest changes from gitlab-org/gitlab@master 2021-07-30 18:09:08 +00:00
GitLab Bot 3462d7613f Add latest changes from gitlab-org/gitlab@master 2021-07-07 00:07:23 +00:00
GitLab Bot 5b829393a7 Add latest changes from gitlab-org/gitlab@master 2021-06-14 21:10:22 +00:00
GitLab Bot f26782b146 Add latest changes from gitlab-org/gitlab@master 2021-05-21 18:11:01 +00:00
GitLab Bot 133ec9237a Add latest changes from gitlab-org/gitlab@master 2021-05-12 09:10:19 +00:00
GitLab Bot 25db9c1230 Add latest changes from gitlab-org/gitlab@master 2021-05-06 12:10:38 +00:00
GitLab Bot 8f4d63426a Add latest changes from gitlab-org/gitlab@master 2021-05-05 18:10:31 +00:00
GitLab Bot e5e0589e09 Add latest changes from gitlab-org/gitlab@master 2021-04-26 12:09:44 +00:00
GitLab Bot 26010cd320 Add latest changes from gitlab-org/gitlab@master 2021-03-21 18:09:29 +00:00
GitLab Bot 4d16568658 Add latest changes from gitlab-org/gitlab@master 2021-03-18 06:11:52 +00:00
GitLab Bot 4fa04f789e Add latest changes from gitlab-org/gitlab@master 2020-09-02 12:10:35 +00:00
GitLab Bot 9b14160725 Add latest changes from gitlab-org/gitlab@master 2020-08-24 18:10:19 +00:00
GitLab Bot e4ea43b2b8 Add latest changes from gitlab-org/gitlab@master 2020-01-27 21:08:47 +00:00
GitLab Bot 3ad11f24ca Add latest changes from gitlab-org/gitlab@master 2019-12-22 09:07:51 +00:00
GitLab Bot 9763c08170 Add latest changes from gitlab-org/gitlab@master 2019-12-17 03:07:45 +00:00
GitLab Bot d10a462fed Add latest changes from gitlab-org/gitlab@master 2019-12-16 12:07:43 +00:00
GitLab Bot 8cc5f27909 Add latest changes from gitlab-org/gitlab@master 2019-12-13 12:07:41 +00:00
GitLab Bot 175b4fa261 Add latest changes from gitlab-org/gitlab@master 2019-12-11 18:08:10 +00: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
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02: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 39ae9a59a5 Make Highlight accept language param
This replaces the repository param.
This allows more flexiblity as sometimes we have highlight content
not related to repository. Sometimes we know ahead of time the language
of the content. Lastly language determination seems better fit as a
logic in the Blob class.
`repository` param is only used to determine the language, which seems
to be the responsiblity of Blob.
2018-10-30 15:44:55 +08:00
gfyoung c858f70d07 Enable frozen string for lib/gitlab/*.rb 2018-10-22 07:00:50 +00:00
Mark Chao 3bfc08be91 Fix syntax highlight taking too long
Use Timeout to switch to plain rendering
2018-09-03 11:02:43 +08:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Douwe Maan e6e29f9220 Use Diff::File blob methods from diff highlighter 2017-06-08 09:39:54 -05:00
Douwe Maan dbffaaa97e Blob#load_all_data! doesn’t need an argument 2017-06-07 14:28:33 -05:00
Douwe Maan b1012d986c Autolink package names in Gemfile 2017-05-10 08:26:21 -05:00
Douwe Maan 6890327762 Copy code as GFM from diffs, blobs and GFM code blocks 2017-03-14 15:29:00 -06:00
http://jneen.net/ c763c7e402 use the proper variable names o_O 2016-07-14 12:21:22 -07:00
http://jneen.net/ b468672d76 style: factor out `@lexer` into a method 2016-07-14 11:44:59 -07:00
http://jneen.net/ 822304b19f fix Gitlab::Highlight#initializer bugs from rebase 2016-07-14 11:40:55 -07:00
http://jneen.net/ f82287e2cc use the local lexer variable to respect plain: ... 2016-07-14 10:08:15 -07:00
http://jneen.net/ 6107933ba3 inline #rouge_formatter 2016-07-14 10:08:15 -07:00
http://jneen.net/ e1824aa101 use the new token_lines interface to format lines 2016-07-14 10:08:15 -07:00
http://jneen.net/ 3bb65815b0 kill the :cssclass option 2016-07-14 10:08:15 -07:00
http://jneen.net/ 7214a221e0 kill the nowrap option
the <pre><code> wrapping is *always* used by the helper, and *never* by
anywhere else, so pull the wrapping into the helper
2016-07-14 10:08:14 -07:00
http://jneen.net/ 7e8a92fbd1 the call site always specifies this option 2016-07-14 10:08:14 -07:00
http://jneen.net/ 681b5af586 do this thing in a clearer way 2016-07-14 10:08:14 -07:00
http://jneen.net/ 66b37149eb support cgi style options, such as erb?parent=json 2016-06-27 14:17:49 -07:00
http://jneen.net/ e08ff468e8 make #custom_language private 2016-06-27 14:17:49 -07:00
http://jneen.net/ c8b52761bc appease rubocop 2016-06-27 14:17:49 -07:00
http://jneen.net/ f8b80f7fae add custom highlighting via .gitattributes
paired with @stanhu
2016-06-27 14:17:49 -07:00
Zeger-Jan van de Weg ad99404d25 Properly handle bigger files 2016-04-28 21:28:39 +02:00