filesize limit on text previews, move markdown preview into own function