fix: anchor Divi name/id patterns at string end, number-advanced stays unknown, doc wording
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ use stdClass;
|
||||
final class Block extends Container
|
||||
{
|
||||
/** A valid block name: "namespace/block-name" (WordPress' own block name convention). */
|
||||
private const NAME_PATTERN = '/^[a-z][a-z0-9_-]*\/[a-z][a-z0-9_-]*$/';
|
||||
private const NAME_PATTERN = '/^[a-z][a-z0-9_-]*\/[a-z][a-z0-9_-]*$/D';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $attrs
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace LIT\MCP\Integrations\Divi\BlockTree;
|
||||
*/
|
||||
final class NodeIndex
|
||||
{
|
||||
public const ID_PATTERN = '/^[srcmgx]\d+(\.[srcmgx]\d+)*$/';
|
||||
public const ID_PATTERN = '/^[srcmgx]\d+(\.[srcmgx]\d+)*$/D';
|
||||
|
||||
/** @var array<string, Block> */
|
||||
private array $byId = [];
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace LIT\MCP\Integrations\Divi\BlockTree;
|
||||
* delimiters; changed or new blocks get delimiters generated exactly like WordPress'
|
||||
* get_comment_delimited_block_content() / serialize_block_attributes() do, which also
|
||||
* yields the escaping Divi expects inside $variable(…)$ payloads: json_encode()'s own
|
||||
* \" (an escaped quote inside a JSON string) is replaced by ", see ESCAPES below.
|
||||
* \" (an escaped quote inside a JSON string) is replaced by \u0022, see ESCAPES below.
|
||||
*/
|
||||
final class Serializer
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user