diff options
author | Stefan Tatschner <stefan@sevenbyte.org> | 2015-06-28 20:45:40 +0200 |
---|---|---|
committer | Stefan Tatschner <rumpelsepp@sevenbyte.org> | 2015-07-29 07:40:58 +0200 |
commit | f736721c5bb8f1f6031d36cc726cbd11cc499a72 (patch) | |
tree | acd3e2d8af691d026b11977dd7010458f01a1aed /lib | |
parent | 5bdcef7b0b6fd9cfdc3498a40d2b2b2a9ddc682c (diff) | |
download | gitlab-ce-f736721c5bb8f1f6031d36cc726cbd11cc499a72.tar.gz |
Replace Rugments with Rouge
I have mainly created the rugments fork for the purpose of improving
gitlab's highlighting. Nowadays IMO it works way better than the old
highlight.js solution. But the development is stuck on my side because
of a couple of personal reasons:
* I have finished my studies; last months I was writing my master
thesis. So there was a huge time problem. I am sorry for that.
* I had to move to Munich due to getting a (paid) job. Searching a
flat here is horrible... :)
* Last but not least, maintaining the same code base in two seperate
projects is a mess.
I have decided to switch back to rouge due to several reasons:
* In the beginning I was quite motivated, but since I start
working on my new job next week, the best solution IMO is
switching back to upstream rouge.
* Rouge is continously improving:
https://github.com/jneen/rouge/blob/master/CHANGELOG.md
http://rouge.jneen.net/
* There should be absolutely no regressions with this change. Most
likely this pull request will almost fix some minor bugs.
* One less gem in gitlab is a good thing. since Gitlab is quite a
huge bundle of gems. Reducing complexity should be a major
milestone.
Thanks a lot to @stanhu and @jneen for the review!
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redcarpet/render/gitlab_html.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 2f7aff03c2a..04440e4f68d 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -22,10 +22,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ERB::Util.html_escape_once(text) end - # Stolen from Rugments::Plugins::Redcarpet as this module is not required - # from Rugments's gem root. + # Stolen from Rouge::Plugins::Redcarpet as this module is not required + # from Rouge's gem root. def block_code(code, language) - lexer = Rugments::Lexer.find_fancy(language, code) || Rugments::Lexers::PlainText + lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::PlainText # XXX HACK: Redcarpet strips hard tabs out of code blocks, # so we assume you're not using leading spaces that aren't tabs, @@ -34,7 +34,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML code.gsub!(/^ /, "\t") end - formatter = Rugments::Formatters::HTML.new( + formatter = Rouge::Formatters::HTMLGitlab.new( cssclass: "code highlight #{@color_scheme} #{lexer.tag}" ) formatter.format(lexer.lex(code)) |