Consider this wikitext: <div style=”{{1x|#123456}}”>foo</div>. That renders as <div style=”#123456”>foo</div> with the legacy parser and <div style=”\n123456”>foo</div> in Parsoid. Parsoid’s output is clearly broken.
This Parsoid behavior is a result of the combination of Parsoid's use of a decoupled parsing model where it uses the core preprocessor to expand templates, and T2529 that requires additional of newlines for templates that start with "#" (among other chars). Parsoid right now just goes bonkers from there since it also expands all complex (anything that isn't a simple string in source) attribute values to HTML in the AttributeExpander and then uses the Sanitizer to convert it back to a string.
T212798: Parsoid chokes on parser functions outputting special characters inside an attribute, replaces all quotes with " is another manifestation of this behavior.