diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-07-18 13:37:23 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-07-18 13:37:23 +0000 |
commit | f6c6e91d9ff81bddac8a0143d96b09b396000a46 (patch) | |
tree | 0c81ef5f508f14976b1a87ef1406b63d747b539d /lib | |
parent | 4e898b9b5e1a782d226212ba6227a8ddcb5177ae (diff) | |
parent | 0c2da7f7348095ae6babeee230484f7f9c59ea62 (diff) | |
download | gitlab-ce-f6c6e91d9ff81bddac8a0143d96b09b396000a46.tar.gz |
Merge branch '18593-avoid-parse_html-when-rinku-didnt-do-anything' into 'master'
Don't parse Rinku returned value to DocFragment when didn't change original html string.
See merge request !5311
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) |