Page MenuHomePhabricator

Additional p tags with next anchor appearing on translated page (due to link in heading)
Open, LowPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?: a span tag has been printed on the displayed page showing the next anchor in english. It corresponds to an additional p tag generated before the next header line (which has again the anchor definition).

What should have happened instead?:
expecting no such display

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

The HTML looks quite broken:

<p>&lt;span id="Apache_Step_2.1._Change_<a href="/wiki/Special:MyLanguage/Manual:$wgUploadPath" title="Special:MyLanguage/Manual:$wgUploadPath">$wgUploadPath</a><span style="display:none"><a href="/wiki/Manual:$wgUploadPath" title="Manual:$wgUploadPath"> </a></span>_in_LocalSettings.php._This_is_not_needed_if_Apache_step_2.2_is_done."&gt;
</p>

This can be worked around by adding nowrap attribute for that translation unit: T62544#8360069

Or just removing the link from the heading, which is not recommended.

Thanks all; I tried the proposed workaround 'translate nowrap' and additional span text no longer appears.

Aklapper renamed this task from translate: additional p tags with next anchor appearing on translated page to Additional p tags with next anchor appearing on translated page (due to link in heading).Apr 4 2023, 12:05 PM

See also -> https://www.mediawiki.org/wiki/Manual:Configuration_for_developers/fr?oldid=5865490#Pour_les_extensions
where there is no explicit link but a tvar declaration as:

<translate>
=== Configuration using <tvar name=1><code>extension.json</code></tvar> (recommended) === <!--T:14-->
</translate>

<p><span id="For_extensions"></span>
</p>
<h2><span class="mw-headline" id="Pour_les_extensions">Pour les extensions</span></h2>
<p>&lt;span id="Configuration_using_<code>extension.json</code>_(recommended)"&gt;

Notice also that reference to such an anchor has a strange format but works on the EN root page -> https://www.mediawiki.org/wiki/Manual:Configuration_for_developers#Configuration_using_extension.json_.28recommended.29

Instead on the translated page, the equivalent link has no signification -> https://www.mediawiki.org/wiki/Manual:Configuration_for_developers/fr#Configuration_using_extension.json_.28recommended.29
and we must use the old anchor declaration form or translated FR section name.

Appears also on https://commons.wikimedia.org/w/index.php?title=Commons:User_access_levels/fr&diff=prev&oldid=803682674 displaying -> <span id="OTRS_members_(removed)"> for -> Translations:Commons:User access levels/30/fr where title has format -> === Membres OTRS {{color|dimGray|(obsolète)}} ===

DIfferent bug: This is caused by padding-bottom added by the Vector skin and also affects Template:Anchor on mediawiki.org. See e.g. T360917: [Spike 3hrs] Unintended vertical spacing behaviour .