Thread:VisualEditor/Feedback/ Bug The VisualEditor unexpectedly deleted infoboxes at top of pages (bug parsing template transclusions).

On French Wikimedia a simple edit (that just added a few words in a paragraph within a section unexpectedly deleted the infobox template transclusion at top of page (there was no change there). The VisualEditor can delete lots of previous contents, and users may not notice it immediately.

I reverted this edit immediately. Evidences show that the VisualEditor does not parse the template transclusions correctly when they span several lines, or more probably if these transclusions contain HTML comments between lines of parameters. This also affects templates for references, that appear in the middle of a paragraph. The VisualEditor also attempts to cleanup unnecessary spaces within named template parameters, throughout the whole edited page (this may be the cause), even if this is not necessary, and we actually did NOT change these parts.

Affected page: Acide Chlorhydrique. (see http://fr.wikipedia.org/w/index.php?title=Acide_chlorhydrique&diff=prev&oldid=94124322)

Note: if we have an autoconfirmed account, the button to review the changes does NOT show the edits that will be done.

There are similar issues of unexpected deletions when adding a category to a page using the "Page Properties" menu item (in addition the category is added near the top of page, grouped on a single line (most used conventions is to place each category on a separate line, facilitating the visual review of diffs).

Please do not alter the content of template transclusions that you cannot understand for now, not even for cleaning up spaces. Do not delete HTML comments, or if you do, make sure that you won't delete the full code of this transclusion.