# File lib/asciidoctor/lexer.rb, line 2162
  def self.reset_block_indent!(lines, indent = 0)
    return if indent.nil? || lines.empty?

    tab_detected = false
    # TODO make tab size configurable
    tab_expansion = '    '
    # strip leading block indent
    offsets = lines.map do |line|
      # break if the first char is non-whitespace
      break [] unless line.chomp[0..0].lstrip.empty?
      if line.include? "\t"
        tab_detected = true
        line = line.gsub("\t", tab_expansion)
      end
      if (flush_line = line.lstrip).empty?
        nil
      elsif (offset = line.length - flush_line.length) == 0
        break []
      else
        offset
      end
    end
    
    unless offsets.empty? || (offsets = offsets.compact).empty?
      if (offset = offsets.min) > 0
        lines.map! {|line|
          line = line.gsub("\t", tab_expansion) if tab_detected
          line[offset..-1] || "\n"
        }
      end
    end

    if indent > 0
      padding = ' ' * indent
      lines.map! {|line| %(#{padding}#{line}) }
    end

    nil
  end