Page MenuHomePhabricator

Templates with an unclosed div should not force using Transclusion dialog to edit the rest of the page
Open, Needs TriagePublicFeature

Description

Steps to replicate the issue:

What happens?:
Since the header template ends with an opening div to provide a layout to the page, every content that follows has been considered as part of the template. So you can only use Transclusion dialog (Template content dialog) to edit the page, in a very non-ergonomical way (in that case, much worse than editing source code).

What should have happened instead?:
The page should be editable, as if the div would be closed.

Same issue: T62395: VisualEditor: Unclosed <dl> and <div> tags caused by absent {{refend}} template cannot be repaired

Event Timeline

Aklapper changed the subtype of this task from "Bug Report" to "Feature Request".Nov 14 2022, 12:29 PM

In my opinion, this should be declined and templates should not leave unclosed <div>s.

Leaving an unclosed <div> is a pretty common feature which allow to wrap a large content without passing it as a parameter, avoiding to escape all pipe char with {{!}} (really noisy code for a table, for example).
E.g. {{Div col}} uses it on en.wp, though the current VE behavior for it may be expected.

Since we cannot probably find a way to guess whether to handle the template as multi-content or as a unique template, I think we could use a templateData property to set the expected behavior.

It would be a large project to try to change this. Right now, in this scenario, the rest of the page really is a part of the transclusion, and we can't make it editable other than as a transclusion.

There are two approaches to improve the situation: (both are large projects)