diff --git a/src/Integrations/Divi/Compose/HtmlContext.php b/src/Integrations/Divi/Compose/HtmlContext.php index 9301494..ca581bc 100644 --- a/src/Integrations/Divi/Compose/HtmlContext.php +++ b/src/Integrations/Divi/Compose/HtmlContext.php @@ -6,7 +6,7 @@ namespace LIT\MCP\Integrations\Divi\Compose; /** * An independent second scan of an HTML fragment (ruling S45): a small state machine after the - * HTML tokenizer rules, written separately from TextReplacer's regex tokenizer so a mistake in + * HTML tokenizer rules, written separately from the regex tokenizer HtmlTokens so a mistake in * one is caught by the other. It lists the byte spans that are NOT text: tags (with quoted * attribute values, where ">" does not end the tag), comments, bogus comments and the bodies of * raw-text elements (script, style, …). Where it is unsure it errs towards "not text": an @@ -15,7 +15,7 @@ namespace LIT\MCP\Integrations\Divi\Compose; */ final class HtmlContext { - /** Elements whose body the browser does not parse as text/markup. */ + /** Elements whose body the browser does not parse as text/markup (= HtmlTokens::RAW_ELEMENTS). */ public const RAW = ['script', 'style', 'xmp', 'iframe', 'noembed', 'noframes', 'noscript', 'plaintext']; /** @return list [start, end) byte spans that are markup or raw bodies. */ diff --git a/src/Integrations/Divi/Compose/HtmlTokens.php b/src/Integrations/Divi/Compose/HtmlTokens.php new file mode 100644 index 0000000..83a8700 --- /dev/null +++ b/src/Integrations/Divi/Compose/HtmlTokens.php @@ -0,0 +1,134 @@ +" inside a quoted attribute value does not end the tag), comments, + * entities and $variable(…)$ references ("token"), the bodies of raw-text elements such as + *