Steps to reproduce:
Edit a page with templates with TemplateStyles transclusion with Visual Editing mode in Visual Editor.
Actual results:
TemplateStyle tags shown as paragraph text near the template.
HTML snippet included below:
<p about="#mwt1" class="ve-ce-leafNode ve-ce-focusableNode ve-ce-mwTransclusionNode ve-ce-focusableNode-focused" contenteditable="false"><templatestyles src="Template:Infobox/style.css" /></p>
Expected results:
TemplateStyle tags should be hidden in Visual Editing mode.
Instead of showing as a paragraph in HTML, it should be wrapped in the style tags.
<style data-mw-deduplicate="TemplateStyles:rxxxxxxx typeof="mw:Extension/templatestyles" ...>CSS here</style>
The TemplateStyles tags are only not parsed when editing in Visual Editing mode in Visual Editor, the tags are properly parsed in normal page view/read mode.
I am on a non-WMF Mediawiki setup, the related versions are included below: