Page MenuHomePhabricator

Don't use <dd> for indenting descriptions on Special:ApiSandbox
Closed, ResolvedPublic


The API sandbox currently uses <dl><dd>description</dd></dl> to indent the parameter descriptions. (mediawiki.special.apisandbox.js)
I know that this is abused on every talk page, but that doesn't make it any better. Instead the description should be indented using CSS and valid HTML.


Related Gerrit Patches:

Event Timeline

Schnark created this task.Sep 22 2016, 8:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 22 2016, 8:23 AM
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Sep 22 2016, 1:59 PM
Anomie added a subscriber: Anomie.Sep 22 2016, 2:05 PM

There's probably not any need for the indenting provided by the <dd>s here at all. But do maintain the separation of items by wrapping each thing that's currently a <dd> in some other block element.

some other block element like a <div> for example ?

Anomie added a comment.Nov 2 2016, 2:16 PM

Yes, <div> is a block element that could be used.

Kosson added a subscriber: Kosson.Nov 12 2016, 11:03 AM

The <span> is the key issue here. It should be a div to allow for semantically correct new elements insertion. Changing from <dl> to other elems, is not a solution.

Anomie updated the task description. (Show Details)Nov 12 2016, 4:13 PM

I tried to change the <span> that contains the <dl><dd>description</dd></dl> into a <div> and the API sandbox remains the same. Is there a page where the abuse takes place so I can try and fix it ?

This comment was removed by Kosson.

Change 339945 had a related patch set uploaded (by Kosson):
Don't use <dd> for indenting descriptions on Special:ApiSandbox

Strainu added a subscriber: Strainu.EditedFeb 26 2017, 8:59 PM

So, I fixed @Kosson's commit to use block-level elements (e.g. imbricated divs). It might be just me, but I think the indentation looked nicer. Would it be enough to add a new class with margin-left: 1.6em for the outer element?

Comparing the two side by side, I like the version without the extra <dd> whitespace better. The description and info is still indented relative to the field name, just not by quite as much.

Change 339945 merged by jenkins-bot:
Don't use <dd> for indenting descriptions on Special:ApiSandbox

Anomie closed this task as Resolved.Feb 28 2017, 4:10 PM