Skip to content

[FIX] 43581: paragraph characteristic is ignored inside lists - #12010

Merged
alex40724 merged 1 commit into
ILIAS-eLearning:release_10from
srsolutionsag:fix/43581/10/paragraph-characteristic-in-lists
Sep 1, 2026
Merged

alex40724 merged 1 commit into
ILIAS-eLearning:release_10from
srsolutionsag:fix/43581/10/paragraph-characteristic-in-lists

Conversation

@chfsx

@chfsx chfsx commented Sep 1, 2026

Copy link
Copy Markdown
Member

Fixes Mantis 43581: https://mantis.ilias.de/view.php?id=43581

Problem
Applying a bullet or numbered list to a paragraph drops its paragraph
characteristic. The text falls back to the default font, although the editor
still shows the characteristic in its dropdown.

Cause
A paragraph containing a list is rendered as div instead of p (page.xsl:929-942),
since ul inside p is invalid HTML. The class is written correctly onto that div
(page.xsl:990): class="ilc_Paragraph ilc_text_block_StandardLarge".
But the content style only emits p.ilc_text_block_ for characteristics of
type text_block (ilObjStyleSheet.php:305, CSSBuilder.php:55), and that selector
does not match a div.

For heading1/2/3 the matching alias already exists (CSSBuilder.php:61-64), which
is why heading characteristics work inside lists since the fix for 41844, while
text block characteristics still do not.

Change
Add the same alias for text_block, plus the eight non-heading classes in the
shipped default style, plus a database update step.

The .ilc_Paragraph part restricts the alias to the paragraph container produced
by the page editor and leaves other divs carrying ilc_text_block_ classes
untouched - notably ilPCDataTableGUI.php:147, where a blanket alias would apply
the padding twice.

The update step is required because style.css is cached per style object
(style_data.uptodate); without it the change has no effect on existing
installations. Same as step_14, step_19 and step_22.

The change applies unmodified to release_11 and trunk; step_23 is free in all
three lines.

A paragraph containing a bullet or numbered list is rendered as div instead of
p (COPage/xsl/page.xsl:929-942), since ul inside p is invalid HTML. The class
is written correctly onto that div (page.xsl:990,
"ilc_Paragraph ilc_text_block_<Characteristic>"), but the content style only
emits the selector p.ilc_text_block_<class> for characteristics of type
text_block (ilObjStyleSheet.php:305, CSSBuilder.php:55) - which does not match
a div. The characteristic is therefore silently dropped as soon as a list is
inserted into the paragraph.

For heading1/2/3 the matching alias already exists (CSSBuilder.php:61-64),
which is why heading characteristics do work inside lists since the fix for
41844, while text block characteristics still do not. That asymmetry is what
the reporter of 43581 describes.

Add the same alias for text_block. The .ilc_Paragraph part restricts it to the
paragraph container produced by the page editor and leaves other divs carrying
ilc_text_block_ classes untouched - notably the table preview container in
PC/Table/class.ilPCDataTableGUI.php:147, where a blanket alias would apply the
padding twice.

The shipped default style needs the same alias for its eight non-heading
classes; heading1/2/3, PageTitle and GlossaryOvTitle already have it.

style.css is cached per style object (style_data.uptodate), so a database
update step is required for the change to take effect on existing
installations - same as step_14, step_19 and step_22.

Introduced by 9cd338e (text_block tag div -> p). Affects 9.8 and later for
text block characteristics; 9.0 to 9.7 additionally produced invalid
<p><ul></p>. ILIAS 8 was unaffected, because text_block used the tag div there.

Verified in a browser against the markup produced by the actual page.xsl: with
the alias, list items inherit the paragraph characteristic for every list item
characteristic, not just StandardListItem, while the table preview container
keeps its single padding.
@chfsx

chfsx commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

The failing pipeline is not caused by this change: the copyright checker rejects the license header of components/ILIAS/Style/classes/Setup/class.ilStyleDBUpdateSteps.php, which carries the older, compact form and is untouched by this PR. The checker only inspects modified files, which is why it surfaces here.

@alex40724
alex40724 merged commit 4b99205 into ILIAS-eLearning:release_10 Sep 1, 2026
0 of 2 checks passed
alex40724 added a commit that referenced this pull request Sep 1, 2026
A paragraph containing a bullet or numbered list is rendered as div instead of
p (COPage/xsl/page.xsl:929-942), since ul inside p is invalid HTML. The class
is written correctly onto that div (page.xsl:990,
"ilc_Paragraph ilc_text_block_<Characteristic>"), but the content style only
emits the selector p.ilc_text_block_<class> for characteristics of type
text_block (ilObjStyleSheet.php:305, CSSBuilder.php:55) - which does not match
a div. The characteristic is therefore silently dropped as soon as a list is
inserted into the paragraph.

For heading1/2/3 the matching alias already exists (CSSBuilder.php:61-64),
which is why heading characteristics do work inside lists since the fix for
41844, while text block characteristics still do not. That asymmetry is what
the reporter of 43581 describes.

Add the same alias for text_block. The .ilc_Paragraph part restricts it to the
paragraph container produced by the page editor and leaves other divs carrying
ilc_text_block_ classes untouched - notably the table preview container in
PC/Table/class.ilPCDataTableGUI.php:147, where a blanket alias would apply the
padding twice.

The shipped default style needs the same alias for its eight non-heading
classes; heading1/2/3, PageTitle and GlossaryOvTitle already have it.

style.css is cached per style object (style_data.uptodate), so a database
update step is required for the change to take effect on existing
installations - same as step_14, step_19 and step_22.

Introduced by 9cd338e (text_block tag div -> p). Affects 9.8 and later for
text block characteristics; 9.0 to 9.7 additionally produced invalid
<p><ul></p>. ILIAS 8 was unaffected, because text_block used the tag div there.

Verified in a browser against the markup produced by the actual page.xsl: with
the alias, list items inherit the paragraph characteristic for every list item
characteristic, not just StandardListItem, while the table preview container
keeps its single padding.
alex40724 added a commit that referenced this pull request Sep 1, 2026
A paragraph containing a bullet or numbered list is rendered as div instead of
p (COPage/xsl/page.xsl:929-942), since ul inside p is invalid HTML. The class
is written correctly onto that div (page.xsl:990,
"ilc_Paragraph ilc_text_block_<Characteristic>"), but the content style only
emits the selector p.ilc_text_block_<class> for characteristics of type
text_block (ilObjStyleSheet.php:305, CSSBuilder.php:55) - which does not match
a div. The characteristic is therefore silently dropped as soon as a list is
inserted into the paragraph.

For heading1/2/3 the matching alias already exists (CSSBuilder.php:61-64),
which is why heading characteristics do work inside lists since the fix for
41844, while text block characteristics still do not. That asymmetry is what
the reporter of 43581 describes.

Add the same alias for text_block. The .ilc_Paragraph part restricts it to the
paragraph container produced by the page editor and leaves other divs carrying
ilc_text_block_ classes untouched - notably the table preview container in
PC/Table/class.ilPCDataTableGUI.php:147, where a blanket alias would apply the
padding twice.

The shipped default style needs the same alias for its eight non-heading
classes; heading1/2/3, PageTitle and GlossaryOvTitle already have it.

style.css is cached per style object (style_data.uptodate), so a database
update step is required for the change to take effect on existing
installations - same as step_14, step_19 and step_22.

Introduced by 9cd338e (text_block tag div -> p). Affects 9.8 and later for
text block characteristics; 9.0 to 9.7 additionally produced invalid
<p><ul></p>. ILIAS 8 was unaffected, because text_block used the tag div there.

Verified in a browser against the markup produced by the actual page.xsl: with
the alias, list items inherit the paragraph characteristic for every list item
characteristic, not just StandardListItem, while the table preview container
keeps its single padding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants