Decide an implementation between the template refactor proposals.
Closed, ResolvedPublic

Description

Quoting T3057: Fix templates for Visual Editor:

  • Definition/Environment template: we prefer the 3.a option. maybe with bots to check standards.
  • Fallback plan: automatically add EndEnvironment
  • Fallback plan * 2: 3.b Cons: no automatic formatting, but should work.

To close this task, evaluate which works, and comment your findings on the T3057: Fix templates for Visual Editor page

ruphy added a comment.EditedJul 12 2016, 11:24 AM

The solution #3 has been implemented, so you would write something like this, for example:

{{Definition|title=environment title}}
The content of the definition, with some <math>\text{math}</math>
{{EndDefinition}}

This will not cause semantic errors or visual glitches if you forget to add {{EndDefition}} or similar tags, as they will only be cosmetic enhancements.

ruphy closed this task as Resolved.Jul 12 2016, 11:25 AM
ruphy claimed this task.
crisbal reopened this task as Open.EditedSep 17 2016, 5:23 PM
crisbal added a subscriber: crisbal.

I would like to reopen this task and discuss it a little bit further.
if we implement the solution number 3, this would require instructing the editors about remembering to close the tag (and this requiring the editor to double interact with VE interface).

It could be very hard for an editor to remember that, since they are not coders and don't know about tags and such things and also is one more thing that could break.

At the same time I acknowledge that we need this solution because of the impossibility to add math inside the templates.

How would we make sure that the final users won't break the page by forgetting about closing the templates? (Maybe develop some kind of extension that on-save checks if the tags are open or closed?)

We could build the templates so they won't break the syntax but if

{{BeginExample}} = <h3>Begin Example</h3>
{{EndExample}} = <hr>

we can't style/really find out the real content of the example which would not happen if we did

{{BeginExample}} = <section class="example">
{{EndExample}} = </section>

but this would expose to the above mentioned malformed HTML problems

Just wanted to hear your opinion on this issue

I know it might be too late but these are a few ideas that came to my mind when discussing with a few editors

I can understand your fear but I think this is still the best option we found when we were choosing what to do with templates. My idea would be to extend visual editor with a gadget listing all the main templates, so when a user choose to insert a predefined template the opening template and closing one are automatically inserted (I don't know if it possible though).

we can't style/really find out the real content of the example which would not happen if we did

{{BeginExample}} = <section class="example">
 {{EndExample}} = </section>

but this would expose to the above mentioned malformed HTML problems

This is right. An alternative could be not to use <section> tags for templates ma html5 tags that don't need to be closed, like <p>.

The gadget for visual editor seems to me the best options. We have not a real alternative I think.

this is fixed?

I built the Visual Editor gadgets.

We are still investigating the way to go but we will probably go this way (not confirmed).

ruphy closed this task as Resolved.Nov 8 2016, 1:58 PM

this was fixed with great style by @crisbal