export tree as md and clean html