Page MenuHomePhabricator

TemplateStyles not loaded in NWE preview
Closed, ResolvedPublic

Description

Whenever I edit pages with templates that use TemplateSyles in the New Wikitext Editor, during the page preview the styles are apparently not loaded at all, leading to a very different result in the preview and after saving. This causes confusion for users not aware of TemplateStyles and makes it impossible to get to see a realistic preview of pages in the NWE. I hope there is an easy fix to the problem!

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptDec 16 2018, 1:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
JTannerWMF moved this task from To Triage to FY 19-20 on the VisualEditor board.Dec 19 2018, 6:40 PM
JTannerWMF added a subscriber: JTannerWMF.

Our plan is to look into the level of effort of fixing this

Cirdan added a subscriber: Cirdan.Dec 20 2018, 4:05 PM
Jc86035 added a comment.EditedDec 18 2019, 3:22 AM

This appears to be more or less the same issue as in T188143: VisualEditor does not like TemplateStyles; the <style>...</style> tags are gone and only <span about="#mwt1"> </span> tags are left.

Anomie moved this task from Up next to External on the TemplateStyles board.Dec 18 2019, 3:49 PM

Anything happening here? Lately I find myself always switching editors whenever I have to work with templates. That slows down the workflow quite a bit.

This is the same as T197563. That task fixed the rendering of templates in visual mode, we need to apply the same fix to preview in wikitext mode.

Change 577275 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] ve.ui.MWSaveDialog: Remove meta element filtering from wikitext preview

https://gerrit.wikimedia.org/r/577275

Change 577275 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ve.ui.MWSaveDialog: Remove meta element filtering from wikitext preview

https://gerrit.wikimedia.org/r/577275

Has this been fixed all of a sudden? Today for the first time templates with TemplateStyles did not look broken anymore when checking the preview. Great!

I was wondering, however, if TemplateStyles could be applied also while loading the VE/NWE (those approx. 2 seconds after clicking the edit button); that's now the only moment I'm aware of where the styles are still missing (except for the talk pages issue pointed out in T251024). It is confusing seeing the page broken, even if it is only for a few seconds. Not sure if it's related to this task, otherwise I will open another one.

Has this been fixed all of a sudden? Today for the first time templates with TemplateStyles did not look broken anymore when checking the preview. Great!

It was fixed by that patch in March, yes, but we had a bit of a backlog in reviewing the tasks.

I was wondering, however, if TemplateStyles could be applied also while loading the VE/NWE (those approx. 2 seconds after clicking the edit button); that's now the only moment I'm aware of where the styles are still missing (except for the talk pages issue pointed out in T251024). It is confusing seeing the page broken, even if it is only for a few seconds. Not sure if it's related to this task, otherwise I will open another one.

Can you file a separate task about it? I think this is caused by how we "disable" the existing style tags on the page when loading the editor (we do this so that the styles no longer apply if you remove the template that adds them in the editor).

I have now opened T254518 for the remaining issue. Good, I guess this task is resolved then, kudos to everyone involved, it's very appreciated!

ppelberg closed this task as Resolved.Jun 5 2020, 1:21 AM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 5 2020, 1:21 AM