diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-18 11:02:19 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-18 13:11:46 +0200 |
commit | 0c2da7f7348095ae6babeee230484f7f9c59ea62 (patch) | |
tree | b600949e434013700786c8e688ad18f6d5d52ebf /lib | |
parent | 240a4aa62ab24a8a7b5545dee6bd2cf00ad7596e (diff) | |
download | gitlab-ce-0c2da7f7348095ae6babeee230484f7f9c59ea62.tar.gz |
Don't parse Rinku returned value to DocFragment when it didn't change the original html string.18593-avoid-parse_html-when-rinku-didnt-do-anything
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/autolink_filter.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/banzai/filter/autolink_filter.rb b/lib/banzai/filter/autolink_filter.rb index fac7dad3243..9ed45707515 100644 --- a/lib/banzai/filter/autolink_filter.rb +++ b/lib/banzai/filter/autolink_filter.rb @@ -56,6 +56,8 @@ module Banzai # period (e.g., http://localhost:3000/) rinku = Rinku.auto_link(html, :urls, options, IGNORE_PARENTS.to_a, 1) + return if rinku == html + # Rinku returns a String, so parse it back to a Nokogiri::XML::Document # for further processing. @doc = parse_html(rinku) |