1
0
Fork 0
hugo/parser
Ville Vesilehto f34cdc382a
parser/metadecoder: Improve errors for non-map XML root values
Previously, the XML decoder would panic when encountering a root element with
a non-map value due to an unsafe type assertion.

The fix adds proper type checking before the map conversion and provides
clear error messages to help users identify and fix invalid XML structures.

Example error for invalid XML like:
<root>just text</root>

Will now return:
"XML root element 'root' must be a map/object, got string"
2025-03-22 18:48:23 +01:00
..
metadecoders parser/metadecoder: Improve errors for non-map XML root values 2025-03-22 18:48:23 +01:00
pageparser all: Run modernize -fix ./... 2025-02-26 11:44:25 +01:00
frontmatter.go Create pages from _content.gotmpl 2024-05-14 13:12:08 +02:00
frontmatter_test.go all: gofmt -w -r 'interface{} -> any' . 2022-03-17 22:03:27 +01:00
lowercase_camel_json.go all: Run modernize -fix ./... 2025-02-26 11:44:25 +01:00
lowercase_camel_json_test.go Create a struct with all of Hugo's config options 2023-05-16 18:01:29 +02:00