Improved handling for YAML and Markdown files