Skip to content

Commit

Permalink
Replace carriage returns with new lines when reading schema as a string
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jan 11, 2024
1 parent e94668b commit 6de556c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hed/schema/hed_schema_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit 6de556c

Please sign in to comment.