Page MenuHomePhabricator

Section preview in new wikitext editor shows Translate markup
Closed, ResolvedPublic

Description

This is with Translate 2014-02-04.

I've created a testcase which you can see by visiting https://www.mediawiki.org/w/index.php?title=User:SamB/tvar_bug&oldid=907218&action=edit&section=1 and clicking the "preview" button.

Notice how all of the Translate markup shows up in the Preview because the <translate> tag isn't in this section? That's kind of annoying.

image.png (741×1 px, 77 KB)

Details

Reference
bz61422

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:57 AM
bzimport set Reference to bz61422.
bzimport added a subscriber: Unknown Object (MLST).

I don't really see a bug here - unclosed tags are probably just displayed like that by the parser, plus this just applies to the preview.
Not sure if that's something to fix in the Translate codebase.

I can’t reproduce with the given testcase. I think this is fixed, isn’t it?

EDIT: except if translate tags are unbalanced, but the same issue would produce with any unbalanced wikitext, I think

@Nikerabbit That’s strange, even with oldid, I can’t reproduce this bug at home: all <translate> tags, balanced or not, are removed from previewing, while editing a section.

When I edit the full page, all translate tags are displayed if one closing tag is missing. But they are all removed (even successive closing tags) if I edit only a section.

Can you post a screenshot?

I believe this was fixed in T168743: Translate tag doesn't get parsed on action=parse, but the new wikitext editor is probably still broken because it does previews differently.

Sorry for the delay. That is the screenshot with legacy 2010 wikitext editor:

image.png (768×1 px, 115 KB)

I have just tried with 2017 NWE. Indeed, with this editor, <translate> tags are displayed:

image.png (652×895 px, 50 KB)

Nikerabbit renamed this task from Section editing preview shows markup due to <translate> tag to Section preview in new wikitext editor shows Translate markup.Mar 30 2020, 7:24 AM

Feedback whether this is fixable there would be appreciated.

JTannerWMF moved this task from To Triage to Triaged on the VisualEditor board.
JTannerWMF subscribed.

Perhaps the Parsing team can have a look to provide an answer.

Arlolra subscribed.

I don't really see a bug here - unclosed tags are probably just displayed like that by the parser, plus this just applies to the preview.
Not sure if that's something to fix in the Translate codebase.

I'm going to agree with this

Just noting that there will be inconsistency with section preview in the old wikitext editor where Translate is hiding the tags using ParserBeforeInternalParse hook.

This issue is technically not triggering anymore, because section editing with the new wikitext editor are back on the legacy parser (see T154844 / https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/808926/). That said, we may want to keep an eye on it because we probably want to check that it indeed works for section preview when Parsoid becomes the default path for read views. My educated guess there is that it *should* work because of the work we've done on T261181, which transforms these translate/tvar tags into <meta> tags, that shouldn't be displayed, but there may be some corner cases on the detection of the annotation (in particular with the deprecated <tvar|name>var</> syntax) outside of a full context.

As suggested by @Arlolra, I reverted https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/808926/ (as well as https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/837636 to get parsedoc back) on my local wiki to re-test the preview with Parsoid. Things work as I expected - the tags are tranformed into <meta> tags and are not visible in the preview. The old <tvar> syntax doesn't break either. Consequently, I'm considering this issue resolved.