Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

(no description)

File Size: 224 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_ChildDef_Table:: (2 methods):
  __construct()
  validateChildren()


Class: HTMLPurifier_ChildDef_Table  - X-Ref

Definition for tables.  The general idea is to extract out all of the
essential bits, and then reconstruct it later.

This is a bit confusing, because the DTDs and the W3C
validators seem to disagree on the appropriate definition. The
DTD claims:

(CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)

But actually, the HTML4 spec then has this to say:

The TBODY start tag is always required except when the table
contains only one table body and no table head or foot sections.
The TBODY end tag may always be safely omitted.

So the DTD is kind of wrong.  The validator is, unfortunately, kind
of on crack.

The definition changed again in XHTML1.1; and in my opinion, this
formulation makes the most sense.

caption?, ( col* | colgroup* ), (( thead?, tfoot?, tbody+ ) | ( tr+ ))

Essentially, we have two modes: thead/tfoot/tbody mode, and tr mode.
If we encounter a thead, tfoot or tbody, we are placed in the former
mode, and we *must* wrap any stray tr segments with a tbody. But if
we don't run into any of them, just have tr tags is OK.
__construct()   X-Ref


validateChildren($children, $config, $context)   X-Ref

param: array $children
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: array