SVWP title DOM differ from displaytitle

Viktoria Hillerud via MediaWiki-l <[email protected]> Mon, 30 Mar 2026 15:26:44 +0200
Newsgroups gmane.org.wikimedia.mediawiki
Message-ID <CAL=ZoLK8oOLLZ+RVr5C1AEJA4Efi5vzfwAkGWkvTqRhJsnk0Qw@mail.gmail.com>
--===============6398049765991083597==
Content-Type: multipart/alternative; boundary="000000000000ee1380064e3dcde8"

--000000000000ee1380064e3dcde8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi!

We are working on the Wikispeech extension and have run into an issue on
Swedish Wikipedia (svwp) where the page title DOM seems different both from
the *displayTitle* returned by the API and from what we see on other wikis.

For example, if we query:

*https://sv.wikipedia.org/w/api.php?action=3Dparse&format=3Djson&page=3DApa=
&prop=3Ddisplaytitle&formatversion=3D2
<https://sv.wikipedia.org/w/api.php?action=3Dparse&format=3Djson&page=3DApa=
&prop=3Ddisplaytitle&formatversion=3D2>*

we get:
*{"title":"Apa","pageid":3877894,"displaytitle":"<span
class=3D\"mw-page-title-main\">Apa</span>"}}*

However, in the actual DOM on svwp, the title appears wrapped differently,
for example:
*<span lang=3D"sv" dir=3D"ltr"><span
class=3D"mw-page-title-main">Apa</span></span> + editsection span*

So it adds an extra *<span>*..

What confuses us is that this seems to behave differently from other wikis
we have tested, such as enwp, where the title DOM appears as the
*displayTitle* structure.

Is there something specific about svwp that causes the page title DOM to be
wrapped differently from other wikis, or has there been any updates
regarding the structure?
Kind regards,
*Viktoria Hillerud Ahlb=C3=A4ck*
*Developer*
Wikimedia Sverige (WMSE)

--000000000000ee1380064e3dcde8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0=
pt;margin-bottom:12pt" id=3D"gmail-docs-internal-guid-49c9381e-7fff-ab2c-ed=
9d-7212f543301b"><span style=3D"font-size:11pt;font-family:Arial,sans-serif=
;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:n=
ormal;font-variant:normal;text-decoration:none;vertical-align:baseline;whit=
e-space:pre-wrap">Hi!</span></p><p dir=3D"ltr" style=3D"line-height:1.38;ma=
rgin-top:12pt;margin-bottom:12pt"><span style=3D"font-size:11pt;font-family=
:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight=
:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-al=
ign:baseline;white-space:pre-wrap">We are working on the Wikispeech extensi=
on and have run into an issue on Swedish Wikipedia (svwp) where the page ti=
tle DOM seems different both from the </span><b><span style=3D"color:rgb(0,=
0,0);background-color:transparent;font-style:normal;font-variant:normal;tex=
t-decoration:none;vertical-align:baseline;white-space:pre-wrap;font-family:=
monospace"><font size=3D"1">displayTitle</font></span></b><span style=3D"fo=
nt-size:11pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color=
:transparent;font-weight:400;font-style:normal;font-variant:normal;text-dec=
oration:none;vertical-align:baseline;white-space:pre-wrap"> returned by the=
 API and from what we see on other wikis.</span></p><p dir=3D"ltr" style=3D=
"line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style=3D"font-s=
ize:11pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:tra=
nsparent;font-weight:400;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;white-space:pre-wrap">For example, if we q=
uery:</span></p><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:12pt;ma=
rgin-bottom:12pt"><b><span style=3D"color:rgb(0,0,0);background-color:trans=
parent;font-style:normal;font-variant:normal;text-decoration:none;vertical-=
align:baseline;white-space:pre-wrap;font-family:monospace"><font size=3D"1"=
><a href=3D"https://sv.wikipedia.org/w/api.php?action=3Dparse&amp;format=3D=
json&amp;page=3DApa&amp;prop=3Ddisplaytitle&amp;formatversion=3D2">https://=
sv.wikipedia.org/w/api.php?action=3Dparse&amp;format=3Djson&amp;page=3DApa&=
amp;prop=3Ddisplaytitle&amp;formatversion=3D2</a></font></span></b></p><p d=
ir=3D"ltr" style=3D"line-height:1.38;margin-top:12pt;margin-bottom:12pt"><s=
pan style=3D"font-size:11pt;font-family:Arial,sans-serif;color:rgb(0,0,0);b=
ackground-color:transparent;font-weight:400;font-style:normal;font-variant:=
normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">w=
e get:</span></p><span style=3D"font-family:monospace"><font size=3D"1"><b>=
<span>{&quot;title&quot;:</span><span class=3D"gmail-=CD=BCz">&quot;Apa&quo=
t;</span><span>,&quot;pageid&quot;:</span><span class=3D"gmail-=CD=BCy">387=
7894</span><span>,&quot;displaytitle&quot;:</span><span class=3D"gmail-=CD=
=BCz">&quot;&lt;span class=3D\&quot;mw-page-title-main\&quot;&gt;Apa&lt;/sp=
an&gt;&quot;</span><span>}}</span></b></font></span><p dir=3D"ltr" style=3D=
"line-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style=3D"font-s=
ize:11pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:tra=
nsparent;font-weight:400;font-style:normal;font-variant:normal;text-decorat=
ion:none;vertical-align:baseline;white-space:pre-wrap">However, in the actu=
al DOM on svwp, the title appears wrapped differently, for example:</span><=
/p><span style=3D"font-family:monospace"><b><font size=3D"1">&lt;span lang=
=3D&quot;sv&quot; dir=3D&quot;ltr&quot;&gt;&lt;span class=3D&quot;mw-page-t=
itle-main&quot;&gt;Apa&lt;/span&gt;&lt;/span&gt; + editsection span</font><=
/b></span><br><font size=3D"1" style=3D"font-family:monospace"><b><br></b><=
/font></div><div><font size=3D"2" face=3D"arial,sans-serif">So it adds an e=
xtra </font><font style=3D"font-family:monospace" size=3D"1"><b>&lt;span&gt=
;</b>..</font><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:12pt;marg=
in-bottom:12pt"><span style=3D"font-size:11pt;font-family:Arial,sans-serif;=
color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:no=
rmal;font-variant:normal;text-decoration:none;vertical-align:baseline;white=
-space:pre-wrap">What confuses us is that this seems to behave differently =
from other wikis we have tested, such as enwp, where the title DOM appears =
as the </span><b><span style=3D"color:rgb(0,0,0);background-color:transpare=
nt;font-style:normal;font-variant:normal;text-decoration:none;vertical-alig=
n:baseline;white-space:pre-wrap;font-family:monospace"><font size=3D"1">dis=
playTitle</font></span></b><span style=3D"font-size:11pt;font-family:Arial,=
sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:400;fo=
nt-style:normal;font-variant:normal;text-decoration:none;vertical-align:bas=
eline;white-space:pre-wrap"> structure.</span></p><p dir=3D"ltr" style=3D"l=
ine-height:1.38;margin-top:12pt;margin-bottom:12pt"><span style=3D"font-siz=
e:11pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:trans=
parent;font-weight:400;font-style:normal;font-variant:normal;text-decoratio=
n:none;vertical-align:baseline;white-space:pre-wrap">Is there something spe=
cific about svwp that causes the page title DOM to be wrapped differently f=
rom other wikis, or has there been any updates regarding the structure?</sp=
an></p>Kind regards,</div><div><div dir=3D"ltr" class=3D"gmail_signature" d=
ata-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><b>Viktoria Hilleru=
d Ahlb=C3=A4ck</b></div><div><i>Developer</i></div><div><span>Wikimedia Sve=
rige (WMSE) <br><br></span></div></div></div></div></div>

--000000000000ee1380064e3dcde8--

--===============6398049765991083597==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
MediaWiki-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
--===============6398049765991083597==--