Method: MarkdownLint::Doc#indent_for

Defined in:
lib/mdl/doc.rb

#indent_for(line) ⇒ Object

Returns how much a given line is indented. Hard tabs are treated as an indent of 8 spaces. You need to pass in the raw string here.



213
214
215
# File 'lib/mdl/doc.rb', line 213

def indent_for(line)
  return line.match(/^\s*/)[0].gsub("\t", " " * 8).length
end