mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-10 17:21:10 +00:00
Closes review comment 1. imex_parallel_mode and imex_head_filament_map were streamed raw into XML attribute values, while every other free-text attribute in the same writer goes through xml_escape. Mode names are free text, so "PLA & ABS", a quote or a "<" made the document malformed. The failure is not a bad value on reload: both load paths for model_settings.config return false on an expat error, and m_is_bbl_3mf is set before the second entry loop runs, so the whole project fails to open with "Archive does not contain a valid model config". Both attributes now use xml_escape_double_quotes_attribute_value(), which also emits tab, CR and LF as numeric character references. That matters and plain xml_escape would not do: XML normalises literal whitespace in attribute values on read, so a tab in a mode name would come back as a space and silently rename the mode. The read side needs no change -- it takes expat's already-decoded value with no second unescape -- so this is a lossless round trip and a file written by the new code still loads in an older build. The round-trip test used "copy_mode", which exercised none of this; it now carries &, <, a quote and a tab, and also pins that ' and > come back unmodified, since both are legal raw inside a double-quoted value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>