diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-10 15:34:29 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-03-14 15:29:00 -0600 |
commit | 6890327762eaeca572ada783804a9c7af01e6144 (patch) | |
tree | 7b02bf428e349024ffa755ea1d7bd4e807e1821c /lib/gitlab/highlight.rb | |
parent | b716680692b4d5f7565e29e8fbd1737d24cbf658 (diff) | |
download | gitlab-ce-6890327762eaeca572ada783804a9c7af01e6144.tar.gz |
Copy code as GFM from diffs, blobs and GFM code blocks
Diffstat (limited to 'lib/gitlab/highlight.rb')
-rw-r--r-- | lib/gitlab/highlight.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb index 9360afedfcb..d787d5db4a0 100644 --- a/lib/gitlab/highlight.rb +++ b/lib/gitlab/highlight.rb @@ -14,7 +14,7 @@ module Gitlab end def initialize(blob_name, blob_content, repository: nil) - @formatter = Rouge::Formatters::HTMLGitlab.new + @formatter = Rouge::Formatters::HTMLGitlab @repository = repository @blob_name = blob_name @blob_content = blob_content @@ -28,7 +28,7 @@ module Gitlab hl_lexer = self.lexer end - @formatter.format(hl_lexer.lex(text, continue: continue)).html_safe + @formatter.format(hl_lexer.lex(text, continue: continue), tag: hl_lexer.tag).html_safe rescue @formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe end |