# File lib/asciidoctor/substitutors.rb, line 396 def sub_replacements text if ReplaceableTextRx.match? text # NOTE interpolation is faster than String#dup text = %(#{text}) REPLACEMENTS.each do |pattern, replacement, restore| # NOTE Using gsub! as optimization text.gsub!(pattern) { do_replacement $~, replacement, restore } end end text end