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.

Event Timeline

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 ?

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

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.

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

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