Don't lstrip data to be parsed by parse_yaml. Fixes #6384

Only used stripped data for testing if the file is json, still use unstripped data when actually parsing. Fixes #6348

This prevents indented yaml on the first line, from being unindented and breaking YAML formatting resulting in a parser error.