move mana parsing server side, add newline support