appears to strip top-level <ul> from lists


2 years ago
2 years ago


(Reporter: wbamberg, Unassigned)




(Whiteboard: [workaround-in-comment-2])



2 years ago
Here's a test page:

* The first section shows what a normal <ul><li>... structure looks like.

* The second section transcludes a <ul><li>... structure from another page. You can see that it's missing the left padding.

If you look at the markup in the devtools, you'll see why: the transcluded <ul> is omitting the <ul> element.

The page is actually using the Template:Page macro[1], but that macro is almost a straight call into

The place I'm trying to use this is here:
The odd thing is that the ID api-list is on the <div> and not the <ul> element, so pulling the contents of the api-list <div> should return the entire list including its surrounding <ul> element. This isn't what should happen.

Now, I've done this by hand using the API, like this:

The result is the same as we see when using the macro. The problem appears to be in the ContentSectionTool class's extractSection() function (and probably in the SectionFilter class), but that's as far as I've been able to get into it since I'm not a Python expert.

Comment 2

2 years ago
Workaround: wrap the <ul> in an extra <div>. The macro strips out the <div>, but leaves the <ul> intact. See "transcluded content, with workaround":
Severity: normal → minor
Keywords: in-triage
Whiteboard: [workaround-in-comment-2]
You need to log in before you can comment on or make changes to this bug.