API / Minn\Html\Tree / ForeignRules

ForeignRules final class

Minn\Html\Tree\ForeignRules · public/minn/src/Minn/Html/Tree/ForeignRules.php · 73 lines

The rules for content in SVG and MathML: text and comments stay in the foreign namespace, an HTML-only start tag (or a font with color, face or size) breaks out back to HTML, other start tags open elements in the current foreign namespace, and an end tag closes the nearest element of its name or falls through to the HTML rules.

Used by 1

Constants and properties

privateBREAKOUT = array ( 0 => 'B', 1 => 'BIG', 2 => 'BLOCKQUOTE', 3 => 'BODY', 4 => 'BR', 5 => 'CENTER', 6 => 'CODE', 7 => 'DD', 8 => 'DIV', 9 => 'DL', 10 => 'DT', 11 => 'EM', 12 => 'EMBED', 13 => 'H1', 14 => 'H2', 15 => 'H3', 16 => 'H4', 17 => 'H5', 18 => 'H6', 19 => 'HEAD', 20 => 'HR', 21 => 'I', 22 => 'IMG', 23 => 'LI', 24 => 'LISTING', 25 => 'MENU', 26 => 'META', 27 => 'NOBR', 28 => 'OL', 29 => 'P', 30 => 'PRE', 31 => 'RUBY', 32 => 'S', 33 => 'SMALL', 34 => 'SPAN', 35 => 'STRONG', 36 => 'STRIKE', 37 => 'SUB', 38 => 'SUP', 39 => 'TABLE', 40 => 'TT', 41 => 'U', 42 => 'UL', 43 => 'VAR', )

Public

staticprocess(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t): void#

Processes one token by the rules for foreign content.

Internals 5

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatetext(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t, string $namespace): void#
privatebreaksOut(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t): bool#
privatebreakOut(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t): void#
privatestart(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t, string $namespace): void#
privateend(Minn\Html\Tree\Builder $b, Minn\Html\Tree\Token $t): void#