module Asciidoctor::Substitutors

def restore_passthroughs text

returns The String text with the passthrough text restored

text - The String text into which to restore the passthrough text

Public: Restore the passthrough text by reinserting into the placeholder positions
def restore_passthroughs text
  passthrus = @passthroughs
  text.gsub PassSlotRx do
    if (pass = passthrus[$1.to_i])
      subbed_text = apply_subs(pass[:text], pass[:subs])
      if (type = pass[:type])
        if (attributes = pass[:attributes])
          id = attributes['id']
        end
        subbed_text = Inline.new(self, :quoted, subbed_text, type: type, id: id, attributes: attributes).convert
      end
      subbed_text.include?(PASS_START) ? restore_passthroughs(subbed_text) : subbed_text
    else
      logger.error %(unresolved passthrough detected: #{text})
      '??pass??'
    end
  end
end