From 6de556c7f09d3d3dc312861d7661017e040417c4 Mon Sep 17 00:00:00 2001 From: IanCa Date: Wed, 10 Jan 2024 18:22:35 -0600 Subject: [PATCH] Replace carriage returns with new lines when reading schema as a string --- hed/schema/hed_schema_io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hed/schema/hed_schema_io.py b/hed/schema/hed_schema_io.py index 63a751d8..e7b43830 100644 --- a/hed/schema/hed_schema_io.py +++ b/hed/schema/hed_schema_io.py @@ -45,6 +45,9 @@ def from_string(schema_string, schema_format=".xml", schema_namespace=None, sche raise HedFileError(HedExceptions.BAD_PARAMETERS, "Empty string passed to HedSchema.from_string", filename=schema_string) + # Replace carriage returns with new lines since this might not be done by the caller + schema_string = schema_string.replace("\r\n", "\n") + if schema_format.endswith(".xml"): hed_schema = SchemaLoaderXML.load(schema_as_string=schema_string, schema=schema) elif schema_format.endswith(".mediawiki"):