Skip to main content
6 of 6
deleted 1 character in body
Rod
  • 18.4k
  • 4
  • 31
  • 89

Python 2, 55 54 51 57 53 bytes

-3 bytes (and a bug fix) thanks to Felipe Nardi Batista

i=0
for c in input():i-=c<'<'*i;print' '*i+c;i+=c>'<'

Try it online!

Rod
  • 18.4k
  • 4
  • 31
  • 89