2024-07-10 16:10:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Kirby\Parsley;
|
|
|
|
|
|
|
|
|
|
/**
|
2025-09-10 14:28:38 +02:00
|
|
|
* Schema definition how to parse
|
|
|
|
|
* the HTML document into blocks
|
2024-07-10 16:10:33 +02:00
|
|
|
*
|
|
|
|
|
* @package Kirby Parsley
|
2025-09-10 14:28:38 +02:00
|
|
|
* @author Bastian Allgeier <bastian@getkirby.com>
|
2024-07-10 16:10:33 +02:00
|
|
|
* @link https://getkirby.com
|
|
|
|
|
* @copyright Bastian Allgeier
|
|
|
|
|
* @license https://getkirby.com/license
|
2025-09-10 14:28:38 +02:00
|
|
|
* @since 3.5.0
|
2024-07-10 16:10:33 +02:00
|
|
|
*/
|
|
|
|
|
class Schema
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Returns the fallback block when no
|
|
|
|
|
* other block type can be detected
|
|
|
|
|
*/
|
|
|
|
|
public function fallback(Element|string $element): array|null
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of allowed inline marks
|
|
|
|
|
* and their parsing rules
|
|
|
|
|
*/
|
|
|
|
|
public function marks(): array
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of allowed nodes and
|
|
|
|
|
* their parsing rules
|
|
|
|
|
*/
|
|
|
|
|
public function nodes(): array
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements that should be
|
|
|
|
|
* skipped and not be parsed at all
|
|
|
|
|
*/
|
|
|
|
|
public function skip(): array
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
}
|