Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a44f5befdbcda376

Jump to content

Template talk:Flat list

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Flat list/doc)
Latest comment: 20 days ago by Izno in topic Inline

Move discussion in progress

[edit]

There is a move discussion in progress on Template talk:Hlist which affects this page. Please participate on that page and not in this talk page section. Thank you. —RMCD bot 02:53, 20 August 2026 (UTC)Reply

Inline

[edit]

Why is {{Inline list}} redirected here when this list isn't inline? I mean, it uses <div> tags, which makes a new block. Example:

Here are some things: {{flatlist|
* foo
* bar
* baz
}}

Here are some things:

  • foo
  • bar
  • baz

From the name "inline" I was expecting it to be on the same line as the previous text.

— W.andrea (talk) 15:15, 30 August 2026 (UTC)Reply

Somebody boldly made a redirect they thought made sense. That's all there is to it sometimes. Izno (talk) 20:02, 31 August 2026 (UTC)Reply
You might ask SMcCandlish, who created the redirect. There are only five transclusions, so if SMcCandlish doesn't respond, you can nominate the redirect for deletion and the cleanup will be easy. – Jonesey95 (talk) 00:33, 1 September 2026 (UTC)Reply
Could have been an error on my part, but the template code actually may have changed in the interim. The essentialy-same-but-for-input-markup template {{hlist}} now uses a Lua module, and it could probably be tweaked to also process the {{flatlist}} template. {{Hlist}} claims to support a |class=inline parameter (which de-<div>-izes). However, in testing I don't find that it works reliably. It does seem to be working in the /doc page transcluded by that template, but when I copy one of the working-there examples to another page, it does not work, and the list displays as a block element, even if I log out and use the Wikipedia sandbox (i.e., it cannot be due to custom CSS in my account, nor the feature being disabled for the User & User_talk namespaces, where I first tried it). If it actually does look correct to you at that sandbox link above, then the issue is apparently in my own browser (presently a recent version of a Firefox fork).

If the problem isn't limited to my personal setup, then there's a bug that needs to be tracked down. My first guess (I'm not a Lua coder) would be a namespace or other test of some sort that isn't coded correctly and usually returns an incorrect value that keeps disabling the inline (<span>) variant markup feature triggered by |class=inline.

Whatever the issue may be, the ideal solution probably would be to fix that, then have both templates use that module for code consistency, then change the {{inline list}} redir to be a wrapper template instead, which would call {{flatlist}} with |class=inline{{#if:{{{class|}}}|,{{{class}}}}} and otherwise pass on all paramaterers; or just directly call the same #invoke:list|horizontal used by {{hlist}} and latterly also by {{flatlist}}.

Failing that, then I suppose the redir should be replaced with a separate template that is not <div>-based and does produce the desired result (presumably using the * input markup expected by {{flatlist}} not {{hlist}}'s |, given that the extant transclusions of {{inline list}} are expecting {{flatlist}} format; or support both styles.

Either of the approaches I tried (marking up <ul> and <li> directly, with no use of <span> or <div>) here seem like they should work, but didn't quite. I suspect there is site-wide CSS forcing linebreaks before and after lists, and that this (along with using · as a list-item separator) would need to be dealt with in TemplateStyles for that template.
 — SMcCandlish ☏ ¢ 😼  06:49, 1 September 2026 (UTC)Reply

This thread is a limitation of HTML: You cannot place an {{hlist}} inline with a <p>...</p> unless that <p>...</p> is also marked as one of the inline flavors of display. The root cause is that you can't put a block element inside an HTML paragraph, which includes any HTML list as well as divs, and a few other structures besides (the spec doesn't use the notion of blocks and inline anymore but you can definitely go look at MDN yourself for the extra understanding if you want, but this same limitation existed in HTML 4.x). In wikitext, you can't mark the display mode of a paragraph (without resorting to HTMLwikitext).
Well, you can't do this safely anyway. Apparently one could add some CSS like p:has(+ .hlist.inline) { display: inline } (which targets the p) but this CSS would definitely have substantial unknown impact (and I can already imagine the "but make it so it doesn't do thats" in waiting). And also we don't have access to :has() in TemplateStyles yet.
Inline hlists inside most discussion responses, inside tables, and a few other locations, will not suffer this existence.
The name is sufficiently ambiguous that we could probably just delete it now anyway, since there are other kinds of flat lists these days ({{cslist}} doing some work somewhere I suppose), even ignoring that you can't mix paragraphs with hlists feasibly. Izno (talk) 07:06, 1 September 2026 (UTC)Reply
You can de-block any block element with display: inline;, so that should work fine. I've used this before in other environments, so if it's not working here it has to be due to something site-wide (perhaps in a CSS interface page, or the parser itself doing something that it thinks is a "correction" in the course of converting wikicode input into final HTML5+CSS3 output). Anyway, yeah, if this not practically fixable, then the redir should be deleted.  — SMcCandlish ☏ ¢ 😼  07:45, 1 September 2026 (UTC)Reply
Thanks, Izno, for the explanation. Wikipedia:Redirects for discussion/Log/2026 September 1#Template:Inline list. – Jonesey95 (talk) 12:04, 1 September 2026 (UTC)Reply
@W.andrea, Izno, Jonesey95, and SMcCandlish: I just remembered where I reported the issue before. See Template talk:Hlist#class=inline not working outside demo. --Redrose64 🌹 (talk) 21:22, 3 September 2026 (UTC)Reply
I have added an example to the documentation. There is probably a less hacky workaround. – Jonesey95 (talk) 22:24, 3 September 2026 (UTC)Reply
This is generally inaccessible, as it obviously disables the paragraphing that should otherwise be available. Izno (talk) 00:33, 4 September 2026 (UTC)Reply
Feel free to provide a better, more accessible workaround if one is available. – Jonesey95 (talk) 19:28, 12 September 2026 (UTC)Reply
There isn't one that isn't resorting to manual paragraph construction, as I said above. I would prefer it removed. Izno (talk) 20:16, 12 September 2026 (UTC)Reply
How do we get an inline list as shown in the example while preserving accessibility? If there is a template that does that, we can just link to it from this template's documentation. – Jonesey95 (talk) 23:13, 12 September 2026 (UTC)Reply
There is no such template. I already said the way to do it is to construct the paragraph manually. It will have other downstream impacts when someone tries to do it (e.g. with VisualEditor).
My general opinion is that there isn't a need for this quality with this template or perhaps even in general. If you really need to have an HTML list inline with an HTML paragraph, what you should do is use commas or semicolons as may be needed, instead. Izno (talk) 23:56, 12 September 2026 (UTC)Reply

"Template:Inline list" listed at Redirects for discussion

[edit]

The redirect Template:Inline list has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2026 September 1 § Template:Inline list until a consensus is reached. – Jonesey95 (talk) 12:04, 1 September 2026 (UTC)Reply

Protected edit request on 12 September 2026

[edit]

Update from the sandbox (diff here) to add a space to the template name in the error message and tracking category. This matches the recent page move. – Jonesey95 (talk) 19:27, 12 September 2026 (UTC)Reply