rajalakshmys-27 commented on PR #3570:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3570#issuecomment-4485328165

   @ljmotta Thanks for the review!
   
   Just to clarify the intent of this fix - the problem it solves is 
specifically the **re-injection bug**: when a faulty file is opened, the 
browser's DOMParser automatically adds a `<parsererror>` node, which then gets 
serialised back into the exported XML on every edit-export cycle, making the 
corruption worse with each save. Filtering it out at the `xml-parser-ts` level 
stops that re-injection.
   
   This approach was also what @tiagobento suggested as a fallback after 
exploring whether the DOMParser behaviour could be customised (it can't, it's 
standard W3C behaviour).
   
   That said, you raise a completely valid point: the user's file is still 
broken even after filtering, and silently allowing edits on a malformed file 
isn't a great experience. I agree we should also surface an error in the editor 
when a `<parsererror>` is detected on load, something that makes it clear the 
file is malformed and that edits may not be reliable.
   
   Would it make sense to handle both in this PR, or would you prefer to track 
the error UI as a separate follow-up? Happy to go either way. 
   cc @thiagoelg


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to