Test document.
Section 1Section 1
One
Section 2Section 2
Two
Section 2.1
Two point one
Section 3Section 3
Three
HTML;
public const TEST_DOC_WITH_LINKS_LEGACY_MARKUP = <<Test document.
Section 1[edit]
One
Section 2[edit]
Two
Section 2.1
Two point one
Section 3[edit]
Three
HTML;
public const TEST_DOC_WITH_LINKS_NEW_MARKUP = <<Test document.
One
Two
Section 2.1
Two point one
Three
HTML;
public const TEST_DOC_WITHOUT_LINKS_LEGACY_MARKUP = <<Test document.
Section 1
One
Section 2
Two
Section 2.1
Two point one
Section 3
Three
HTML;
public const TEST_DOC_WITHOUT_LINKS_NEW_MARKUP = <<Test document.
Section 1
One
Section 2
Two
Section 2.1
Two point one
Section 3
Three
HTML;
// In this test, the `>` is not escaped in the 'data-mw-anchor' attribute and tag content, which
// is allowed in HTML, but it's not the serialization used by the Parser. Extensions that modify
// the HTML, e.g. DiscussionTools, can cause this to appear.
public const TEST_DOC_ANGLE_BRACKETS = <<>>
HTML;
public const TEST_DOC_ANGLE_BRACKETS_WITH_LINKS_LEGACY_MARKUP = <<>[edit]
HTML;
public const TEST_DOC_ANGLE_BRACKETS_WITH_LINKS_NEW_MARKUP = <<>
[edit]
HTML;
public const TEST_DOC_ANGLE_BRACKETS_WITHOUT_LINKS_LEGACY_MARKUP = <<>
HTML;
public const TEST_DOC_ANGLE_BRACKETS_WITHOUT_LINKS_NEW_MARKUP = <<>
HTML;
public const TEST_TO_DEDUP = <<This is a test document.
HTML;
public static function initSections( ParserOutput $po ): void {
$po->setTOCData( new TOCData( SectionMetadata::fromLegacy( [
'index' => "1",
'level' => 1,
'toclevel' => 1,
'number' => "1",
'line' => "Section 1",
'anchor' => "Section_1"
] ), SectionMetadata::fromLegacy( [
'index' => "2",
'level' => 1,
'toclevel' => 1,
'number' => "2",
'line' => "Section 2",
'anchor' => "Section_2"
] ), SectionMetadata::fromLegacy( [
'index' => "3",
'level' => 2,
'toclevel' => 2,
'number' => "2.1",
'line' => "Section 2.1",
'anchor' => "Section_2.1"
] ), SectionMetadata::fromLegacy( [
'index' => "4",
'level' => 1,
'toclevel' => 1,
'number' => "3",
'line' => "Section 3",
'anchor' => "Section_3"
] ), ) );
}
}