@@ -213,26 +213,30 @@ def absolute_url_regex(url, disabled = false)
213213
214214 def relativize_urls ( doc , regex )
215215 return if doc . output . nil?
216-
217- doc . output . gsub! ( regex , "href=\" #{ @baseurl } /#{ @active_lang } /" + '\1"' )
216+ modified_output = doc . output . dup
217+ modified_output . gsub! ( regex , "href=\" #{ @baseurl } /#{ @active_lang } /" + '\1"' )
218+ doc . output = modified_output
218219 end
219220
220221 def relativize_absolute_urls ( doc , regex , url )
221222 return if doc . output . nil?
222-
223- doc . output . gsub! ( regex , "href=\" #{ url } #{ @baseurl } /#{ @active_lang } /" + '\1"' )
223+ modified_output = doc . output . dup
224+ modified_output . gsub! ( regex , "href=\" #{ url } #{ @baseurl } /#{ @active_lang } /" + '\1"' )
225+ doc . output = modified_output
224226 end
225227
226228 def correct_nonrelativized_absolute_urls ( doc , regex , url )
227229 return if doc . output . nil?
228-
229- doc . output . gsub! ( regex , "href=\" #{ url } #{ @baseurl } /" + '\1"' )
230+ modified_output = doc . output . dup
231+ modified_output . gsub! ( regex , "href=\" #{ url } #{ @baseurl } /" + '\1"' )
232+ doc . output = modified_output
230233 end
231234
232235 def correct_nonrelativized_urls ( doc , regex )
233236 return if doc . output . nil?
234-
235- doc . output . gsub! ( regex , "href=\" #{ @baseurl } /" + '\1"' )
237+ modified_output = doc . output . dup
238+ modified_output . gsub! ( regex , "href=\" #{ @baseurl } /" + '\1"' )
239+ doc . output = modified_output
236240 end
237241 end
238242end
0 commit comments