Definition at line 70 of file PH5P.php.
◆ __construct() [1/2]
HTML5::__construct |
( |
|
$data | ) |
|
Definition at line 461 of file PH5P.php.
References $data, data, and EOF.
467 $this->content_model = self::PCDATA;
469 $this->state =
'data';
471 while ($this->state !== null) {
472 $this->{$this->state .
'State'}();
◆ __construct() [2/2]
HTML5::__construct |
( |
|
$data | ) |
|
Definition at line 67 of file PH5P.php.
References $data, data, and EOF().
70 $date = str_replace(
"\r", null,
$data);
76 $this->content_model = self::PCDATA;
78 $this->state =
'data';
80 while($this->state !== null) {
81 $this->{$this->state.
'State'}();
◆ afterAttributeNameState() [1/2]
HTML5::afterAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 535 of file PH5P.php.
References $char, array, character(), emitToken(), and EOF().
541 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
548 $this->state =
'afterAttributeName';
550 } elseif(
$char ===
'=') {
553 $this->state =
'beforeAttributeValue';
555 } elseif(
$char ===
'>') {
559 $this->state =
'data';
561 } elseif(
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
565 $this->state =
'beforeAttributeName';
567 } elseif($this->
char === $this->
EOF) {
574 $this->state =
'data';
581 $this->token[
'attr'][] =
array(
582 'name' => strtolower(
$char),
586 $this->state =
'attributeName';
Create styles array
The data for the language used.
◆ afterAttributeNameState() [2/2]
HTML5::afterAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 955 of file PH5P.php.
References array, and EOF.
961 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
968 $this->state =
'afterAttributeName';
970 } elseif (
$char ===
'=') {
973 $this->state =
'beforeAttributeValue';
975 } elseif (
$char ===
'>') {
979 $this->state =
'data';
981 } elseif (
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
985 $this->state =
'beforeAttributeName';
987 } elseif ($this->
char === $this->
EOF) {
994 $this->state =
'data';
1001 $this->token[
'attr'][] =
array(
1002 'name' => strtolower(
$char),
1006 $this->state =
'attributeName';
Create styles array
The data for the language used.
◆ afterDoctypeNameState() [1/2]
HTML5::afterDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 991 of file PH5P.php.
References $char, char(), emitToken(), and EOF().
997 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1000 } elseif(
$char ===
'>') {
1002 $this->state =
'data';
1004 } elseif($this->
char === $this->
EOF) {
1007 $this->state =
'data';
1010 $this->token[
'error'] =
true;
1011 $this->state =
'bogusDoctype';
◆ afterDoctypeNameState() [2/2]
HTML5::afterDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1418 of file PH5P.php.
References EOF.
1424 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1427 } elseif (
$char ===
'>') {
1429 $this->state =
'data';
1431 } elseif ($this->
char === $this->
EOF) {
1434 $this->state =
'data';
1437 $this->token[
'error'] =
true;
1438 $this->state =
'bogusDoctype';
◆ attributeNameState() [1/2]
HTML5::attributeNameState |
( |
| ) |
|
|
private |
Definition at line 483 of file PH5P.php.
References $char, character(), emitToken(), and EOF().
489 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
496 $this->state =
'afterAttributeName';
498 } elseif(
$char ===
'=') {
501 $this->state =
'beforeAttributeValue';
503 } elseif(
$char ===
'>') {
507 $this->state =
'data';
509 } elseif(
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
513 $this->state =
'beforeAttributeName';
515 } elseif($this->
char === $this->
EOF) {
522 $this->state =
'data';
528 $last = count($this->token[
'attr']) - 1;
529 $this->token[
'attr'][$last][
'name'] .= strtolower(
$char);
531 $this->state =
'attributeName';
◆ attributeNameState() [2/2]
HTML5::attributeNameState |
( |
| ) |
|
|
private |
Definition at line 903 of file PH5P.php.
References EOF.
909 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
916 $this->state =
'afterAttributeName';
918 } elseif (
$char ===
'=') {
921 $this->state =
'beforeAttributeValue';
923 } elseif (
$char ===
'>') {
927 $this->state =
'data';
929 } elseif (
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
933 $this->state =
'beforeAttributeName';
935 } elseif ($this->
char === $this->
EOF) {
942 $this->state =
'data';
948 $last = count($this->token[
'attr']) - 1;
949 $this->token[
'attr'][$last][
'name'] .= strtolower(
$char);
951 $this->state =
'attributeName';
◆ attributeValueDoubleQuotedState() [1/2]
HTML5::attributeValueDoubleQuotedState |
( |
| ) |
|
|
private |
Definition at line 639 of file PH5P.php.
References $char, character(), emitToken(), entityInAttributeValueState(), and EOF().
648 $this->state =
'beforeAttributeName';
650 } elseif(
$char ===
'&') {
655 } elseif($this->
char === $this->
EOF) {
662 $this->state =
'data';
668 $last = count($this->token[
'attr']) - 1;
669 $this->token[
'attr'][$last][
'value'] .=
$char;
671 $this->state =
'attributeValueDoubleQuoted';
entityInAttributeValueState()
◆ attributeValueDoubleQuotedState() [2/2]
HTML5::attributeValueDoubleQuotedState |
( |
| ) |
|
|
private |
Definition at line 1059 of file PH5P.php.
References EOF.
1065 if (
$char ===
'"') {
1068 $this->state =
'beforeAttributeName';
1070 } elseif (
$char ===
'&') {
1075 } elseif ($this->
char === $this->
EOF) {
1082 $this->state =
'data';
1088 $last = count($this->token[
'attr']) - 1;
1089 $this->token[
'attr'][$last][
'value'] .=
$char;
1091 $this->state =
'attributeValueDoubleQuoted';
entityInAttributeValueState()
◆ attributeValueSingleQuotedState() [1/2]
HTML5::attributeValueSingleQuotedState |
( |
| ) |
|
|
private |
Definition at line 675 of file PH5P.php.
References $char, character(), emitToken(), entityInAttributeValueState(), and EOF().
684 $this->state =
'beforeAttributeName';
686 } elseif(
$char ===
'&') {
691 } elseif($this->
char === $this->
EOF) {
698 $this->state =
'data';
704 $last = count($this->token[
'attr']) - 1;
705 $this->token[
'attr'][$last][
'value'] .=
$char;
707 $this->state =
'attributeValueSingleQuoted';
entityInAttributeValueState()
◆ attributeValueSingleQuotedState() [2/2]
HTML5::attributeValueSingleQuotedState |
( |
| ) |
|
|
private |
Definition at line 1095 of file PH5P.php.
References EOF.
1101 if (
$char ===
'\'') {
1104 $this->state =
'beforeAttributeName';
1106 } elseif (
$char ===
'&') {
1111 } elseif ($this->
char === $this->
EOF) {
1118 $this->state =
'data';
1124 $last = count($this->token[
'attr']) - 1;
1125 $this->token[
'attr'][$last][
'value'] .=
$char;
1127 $this->state =
'attributeValueSingleQuoted';
entityInAttributeValueState()
◆ attributeValueUnquotedState() [1/2]
HTML5::attributeValueUnquotedState |
( |
| ) |
|
|
private |
Definition at line 711 of file PH5P.php.
References $char, character(), emitToken(), and entityInAttributeValueState().
717 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
724 $this->state =
'beforeAttributeName';
726 } elseif(
$char ===
'&') {
731 } elseif(
$char ===
'>') {
735 $this->state =
'data';
741 $last = count($this->token[
'attr']) - 1;
742 $this->token[
'attr'][$last][
'value'] .=
$char;
744 $this->state =
'attributeValueUnquoted';
entityInAttributeValueState()
◆ attributeValueUnquotedState() [2/2]
HTML5::attributeValueUnquotedState |
( |
| ) |
|
|
private |
Definition at line 1131 of file PH5P.php.
1137 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1144 $this->state =
'beforeAttributeName';
1146 } elseif (
$char ===
'&') {
1151 } elseif (
$char ===
'>') {
1155 $this->state =
'data';
1161 $last = count($this->token[
'attr']) - 1;
1162 $this->token[
'attr'][$last][
'value'] .=
$char;
1164 $this->state =
'attributeValueUnquoted';
entityInAttributeValueState()
◆ beforeAttributeNameState() [1/2]
HTML5::beforeAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 433 of file PH5P.php.
References $char, array, character(), emitToken(), and EOF().
439 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
446 $this->state =
'beforeAttributeName';
448 } elseif(
$char ===
'>') {
452 $this->state =
'data';
454 } elseif(
$char ===
'/') {
458 $this->state =
'beforeAttributeName';
460 } elseif($this->
char === $this->
EOF) {
467 $this->state =
'data';
474 $this->token[
'attr'][] =
array(
475 'name' => strtolower(
$char),
479 $this->state =
'attributeName';
Create styles array
The data for the language used.
◆ beforeAttributeNameState() [2/2]
HTML5::beforeAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 853 of file PH5P.php.
References array, and EOF.
859 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
866 $this->state =
'beforeAttributeName';
868 } elseif (
$char ===
'>') {
872 $this->state =
'data';
874 } elseif (
$char ===
'/') {
878 $this->state =
'beforeAttributeName';
880 } elseif ($this->
char === $this->
EOF) {
887 $this->state =
'data';
894 $this->token[
'attr'][] =
array(
895 'name' => strtolower(
$char),
899 $this->state =
'attributeName';
Create styles array
The data for the language used.
◆ beforeAttributeValueState() [1/2]
HTML5::beforeAttributeValueState |
( |
| ) |
|
|
private |
Definition at line 590 of file PH5P.php.
References $char, character(), and emitToken().
596 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
603 $this->state =
'beforeAttributeValue';
605 } elseif(
$char ===
'"') {
608 $this->state =
'attributeValueDoubleQuoted';
610 } elseif(
$char ===
'&') {
615 $this->state =
'attributeValueUnquoted';
617 } elseif(
$char ===
'\'') {
620 $this->state =
'attributeValueSingleQuoted';
622 } elseif(
$char ===
'>') {
626 $this->state =
'data';
632 $last = count($this->token[
'attr']) - 1;
633 $this->token[
'attr'][$last][
'value'] .=
$char;
635 $this->state =
'attributeValueUnquoted';
◆ beforeAttributeValueState() [2/2]
HTML5::beforeAttributeValueState |
( |
| ) |
|
|
private |
Definition at line 1010 of file PH5P.php.
1016 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1023 $this->state =
'beforeAttributeValue';
1025 } elseif (
$char ===
'"') {
1028 $this->state =
'attributeValueDoubleQuoted';
1030 } elseif (
$char ===
'&') {
1035 $this->state =
'attributeValueUnquoted';
1037 } elseif (
$char ===
'\'') {
1040 $this->state =
'attributeValueSingleQuoted';
1042 } elseif (
$char ===
'>') {
1046 $this->state =
'data';
1052 $last = count($this->token[
'attr']) - 1;
1053 $this->token[
'attr'][$last][
'value'] .=
$char;
1055 $this->state =
'attributeValueUnquoted';
◆ beforeDoctypeNameState() [1/2]
HTML5::beforeDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 913 of file PH5P.php.
References $char, array, char(), emitToken(), and EOF().
919 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
922 } elseif(preg_match(
'/^[a-z]$/',
$char)) {
923 $this->token =
array(
924 'name' => strtoupper(
$char),
925 'type' => self::DOCTYPE,
929 $this->state =
'doctypeName';
931 } elseif(
$char ===
'>') {
934 'type' => self::DOCTYPE,
938 $this->state =
'data';
940 } elseif($this->
char === $this->
EOF) {
943 'type' => self::DOCTYPE,
948 $this->state =
'data';
951 $this->token =
array(
953 'type' => self::DOCTYPE,
957 $this->state =
'doctypeName';
Create styles array
The data for the language used.
◆ beforeDoctypeNameState() [2/2]
HTML5::beforeDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1336 of file PH5P.php.
References array, and EOF.
1342 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1345 } elseif (preg_match(
'/^[a-z]$/',
$char)) {
1346 $this->token =
array(
1347 'name' => strtoupper(
$char),
1348 'type' => self::DOCTYPE,
1352 $this->state =
'doctypeName';
1354 } elseif (
$char ===
'>') {
1358 'type' => self::DOCTYPE,
1363 $this->state =
'data';
1365 } elseif ($this->
char === $this->
EOF) {
1369 'type' => self::DOCTYPE,
1375 $this->state =
'data';
1378 $this->token =
array(
1380 'type' => self::DOCTYPE,
1384 $this->state =
'doctypeName';
Create styles array
The data for the language used.
◆ bogusCommentState() [1/2]
HTML5::bogusCommentState |
( |
| ) |
|
|
private |
Definition at line 763 of file PH5P.php.
References array, characters(), emitToken(), and EOF().
776 'type' => self::COMMENT
779 $this->
char += strlen(
$data);
782 $this->state =
'data';
785 if($this->
char === $this->
EOF) {
786 $this->
char = $this->
EOF - 1;
characters($char_class, $start)
Create styles array
The data for the language used.
◆ bogusCommentState() [2/2]
HTML5::bogusCommentState |
( |
| ) |
|
|
private |
Definition at line 1184 of file PH5P.php.
References $data, array, and EOF.
1198 'type' => self::COMMENT
1202 $this->
char += strlen(
$data);
1205 $this->state =
'data';
1208 if ($this->
char === $this->
EOF) {
1209 $this->
char = $this->
EOF - 1;
characters($char_class, $start)
Create styles array
The data for the language used.
◆ bogusDoctypeState() [1/2]
HTML5::bogusDoctypeState |
( |
| ) |
|
|
private |
◆ bogusDoctypeState() [2/2]
HTML5::bogusDoctypeState |
( |
| ) |
|
|
private |
Definition at line 1442 of file PH5P.php.
References EOF.
1448 if (
$char ===
'>') {
1450 $this->state =
'data';
1452 } elseif ($this->
char === $this->
EOF) {
1455 $this->state =
'data';
◆ char() [1/2]
◆ char() [2/2]
Definition at line 481 of file PH5P.php.
References data, and EOF.
Referenced by afterDoctypeNameState(), beforeDoctypeNameState(), bogusDoctypeState(), closeTagOpenState(), commentDashState(), commentEndState(), commentState(), dataState(), doctypeNameState(), doctypeState(), and tagOpenState().
483 return ($this->char < $this->
EOF)
◆ character() [1/2]
HTML5::character |
( |
|
$s, |
|
|
|
$l = 0 |
|
) |
| |
|
private |
◆ character() [2/2]
HTML5::character |
( |
|
$s, |
|
|
|
$l = 0 |
|
) |
| |
|
private |
Definition at line 488 of file PH5P.php.
References $l, data, and EOF.
Referenced by afterAttributeNameState(), attributeNameState(), attributeValueDoubleQuotedState(), attributeValueSingleQuotedState(), attributeValueUnquotedState(), beforeAttributeNameState(), beforeAttributeValueState(), closeTagOpenState(), dataState(), entity(), markupDeclarationOpenState(), tagNameState(), and tagOpenState().
490 if ($s + $l < $this->
EOF) {
492 return $this->
data[$s];
494 return substr($this->
data, $s,
$l);
◆ characters() [1/2]
HTML5::characters |
( |
|
$char_class, |
|
|
|
$start |
|
) |
| |
|
private |
Definition at line 108 of file PH5P.php.
References $start, and data.
110 return preg_replace(
'#^(['.$char_class.
']+).*#s',
'\\1', substr($this->
data,
$start));
◆ characters() [2/2]
HTML5::characters |
( |
|
$char_class, |
|
|
|
$start |
|
) |
| |
|
private |
◆ closeTagOpenState() [1/2]
HTML5::closeTagOpenState |
( |
| ) |
|
|
private |
Definition at line 314 of file PH5P.php.
References $char, array, char(), character(), characters(), emitToken(), and EOF().
316 $next_node = strtolower($this->
characters(
'A-Za-z', $this->
char + 1));
317 $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName;
319 if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) &&
320 (!$the_same || ($the_same && (!preg_match(
'/[\t\n\x0b\x0c >\/]/',
321 $this->
character($this->
char + 1 + strlen($next_node))) || $this->
EOF === $this->
char)))) {
338 'type' => self::CHARACTR,
342 $this->state =
'data';
351 if(preg_match(
'/^[A-Za-z]$/',
$char)) {
357 $this->token =
array(
358 'name' => strtolower(
$char),
359 'type' => self::ENDTAG
362 $this->state =
'tagName';
364 } elseif(
$char ===
'>') {
367 $this->state =
'data';
369 } elseif($this->
char === $this->
EOF) {
374 'type' => self::CHARACTR,
379 $this->state =
'data';
383 $this->state =
'bogusComment';
characters($char_class, $start)
Create styles array
The data for the language used.
◆ closeTagOpenState() [2/2]
HTML5::closeTagOpenState |
( |
| ) |
|
|
private |
Definition at line 727 of file PH5P.php.
References array, and EOF.
729 $next_node = strtolower($this->
characters(
'A-Za-z', $this->
char + 1));
730 $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName;
732 if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) &&
733 (!$the_same || ($the_same && (!preg_match(
734 '/[\t\n\x0b\x0c >\/]/',
735 $this->
character($this->
char + 1 + strlen($next_node))
736 ) || $this->
EOF === $this->
char)))
755 'type' => self::CHARACTR,
760 $this->state =
'data';
769 if (preg_match(
'/^[A-Za-z]$/',
$char)) {
775 $this->token =
array(
776 'name' => strtolower(
$char),
777 'type' => self::ENDTAG
780 $this->state =
'tagName';
782 } elseif (
$char ===
'>') {
785 $this->state =
'data';
787 } elseif ($this->
char === $this->
EOF) {
793 'type' => self::CHARACTR,
799 $this->state =
'data';
803 $this->state =
'bogusComment';
characters($char_class, $start)
Create styles array
The data for the language used.
◆ commentDashState() [1/2]
HTML5::commentDashState |
( |
| ) |
|
|
private |
Definition at line 846 of file PH5P.php.
References $char, char(), emitToken(), and EOF().
855 $this->state =
'commentEnd';
858 } elseif($this->
char === $this->
EOF) {
863 $this->state =
'data';
869 $this->token[
'data'] .=
'-'.$char;
870 $this->state =
'comment';
◆ commentDashState() [2/2]
HTML5::commentDashState |
( |
| ) |
|
|
private |
Definition at line 1269 of file PH5P.php.
References EOF.
1276 if (
$char ===
'-') {
1278 $this->state =
'commentEnd';
1281 } elseif ($this->
char === $this->
EOF) {
1286 $this->state =
'data';
1292 $this->token[
'data'] .=
'-' .
$char;
1293 $this->state =
'comment';
◆ commentEndState() [1/2]
HTML5::commentEndState |
( |
| ) |
|
|
private |
Definition at line 874 of file PH5P.php.
References $char, char(), emitToken(), and EOF().
882 $this->state =
'data';
884 } elseif(
$char ===
'-') {
885 $this->token[
'data'] .=
'-';
887 } elseif($this->
char === $this->
EOF) {
890 $this->state =
'data';
893 $this->token[
'data'] .=
'--'.$char;
894 $this->state =
'comment';
◆ commentEndState() [2/2]
HTML5::commentEndState |
( |
| ) |
|
|
private |
Definition at line 1297 of file PH5P.php.
References EOF.
1303 if (
$char ===
'>') {
1305 $this->state =
'data';
1307 } elseif (
$char ===
'-') {
1308 $this->token[
'data'] .=
'-';
1310 } elseif ($this->
char === $this->
EOF) {
1313 $this->state =
'data';
1316 $this->token[
'data'] .=
'--' .
$char;
1317 $this->state =
'comment';
◆ commentState() [1/2]
◆ commentState() [2/2]
Definition at line 1242 of file PH5P.php.
References EOF.
1249 if (
$char ===
'-') {
1251 $this->state =
'commentDash';
1254 } elseif ($this->
char === $this->
EOF) {
1259 $this->state =
'data';
1265 $this->token[
'data'] .=
$char;
◆ dataState() [1/2]
Definition at line 113 of file PH5P.php.
References $char, array, char(), character(), data, emitToken(), and EOF().
119 if(
$char ===
'&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) {
124 $this->state =
'entityData';
126 } elseif(
$char ===
'-') {
133 if(($this->content_model === self::RCDATA || $this->content_model ===
134 self::CDATA) && $this->escape ===
false &&
135 $this->
char >= 3 && $this->
character($this->
char - 4, 4) ===
'<!--') {
136 $this->escape =
true;
142 'type' => self::CHARACTR,
147 } elseif(
$char ===
'<' && ($this->content_model === self::PCDATA ||
148 (($this->content_model === self::RCDATA ||
149 $this->content_model === self::CDATA) && $this->escape ===
false))) {
158 $this->state =
'tagOpen';
161 } elseif(
$char ===
'>') {
167 if(($this->content_model === self::RCDATA ||
168 $this->content_model === self::CDATA) && $this->escape ===
true &&
169 $this->
character($this->
char, 3) ===
'-->') {
170 $this->escape =
false;
176 'type' => self::CHARACTR,
180 } elseif($this->
char === $this->
EOF) {
185 } elseif($this->content_model === self::PLAINTEXT) {
190 'type' => self::CHARACTR,
191 'data' => substr($this->
data, $this->
char)
201 $len = strcspn($this->
data,
'<&', $this->
char);
202 $char = substr($this->
data, $this->
char, $len);
203 $this->
char += $len - 1;
206 'type' => self::CHARACTR,
210 $this->state =
'data';
Create styles array
The data for the language used.
◆ dataState() [2/2]
Definition at line 504 of file PH5P.php.
References array, data, and EOF.
510 if (
$char ===
'&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) {
515 $this->state =
'entityData';
517 } elseif (
$char ===
'-') {
524 if (($this->content_model === self::RCDATA || $this->content_model ===
525 self::CDATA) && $this->escape ===
false &&
526 $this->
char >= 3 && $this->
character($this->
char - 4, 4) ===
'<!--' 528 $this->escape =
true;
535 'type' => self::CHARACTR,
541 } elseif (
$char ===
'<' && ($this->content_model === self::PCDATA ||
542 (($this->content_model === self::RCDATA ||
543 $this->content_model === self::CDATA) && $this->escape ===
false))
553 $this->state =
'tagOpen';
556 } elseif (
$char ===
'>') {
562 if (($this->content_model === self::RCDATA ||
563 $this->content_model === self::CDATA) && $this->escape ===
true &&
564 $this->
character($this->
char, 3) ===
'-->' 566 $this->escape =
false;
573 'type' => self::CHARACTR,
578 } elseif ($this->
char === $this->
EOF) {
583 } elseif ($this->content_model === self::PLAINTEXT) {
589 'type' => self::CHARACTR,
590 'data' => substr($this->
data, $this->
char)
601 $len = strcspn($this->
data,
'<&', $this->
char);
602 $char = substr($this->
data, $this->
char, $len);
603 $this->
char += $len - 1;
607 'type' => self::CHARACTR,
612 $this->state =
'data';
Create styles array
The data for the language used.
◆ doctypeNameState() [1/2]
HTML5::doctypeNameState |
( |
| ) |
|
|
private |
Definition at line 961 of file PH5P.php.
References $char, char(), emitToken(), and EOF().
967 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
968 $this->state =
'AfterDoctypeName';
970 } elseif(
$char ===
'>') {
972 $this->state =
'data';
974 } elseif(preg_match(
'/^[a-z]$/',
$char)) {
975 $this->token[
'name'] .= strtoupper(
$char);
977 } elseif($this->
char === $this->
EOF) {
980 $this->state =
'data';
983 $this->token[
'name'] .=
$char;
986 $this->token[
'error'] = ($this->token[
'name'] ===
'HTML')
◆ doctypeNameState() [2/2]
HTML5::doctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1388 of file PH5P.php.
References EOF.
1394 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1395 $this->state =
'AfterDoctypeName';
1397 } elseif (
$char ===
'>') {
1399 $this->state =
'data';
1401 } elseif (preg_match(
'/^[a-z]$/',
$char)) {
1402 $this->token[
'name'] .= strtoupper(
$char);
1404 } elseif ($this->
char === $this->
EOF) {
1407 $this->state =
'data';
1410 $this->token[
'name'] .=
$char;
1413 $this->token[
'error'] = ($this->token[
'name'] ===
'HTML')
◆ doctypeState() [1/2]
Definition at line 898 of file PH5P.php.
References $char, and char().
904 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
905 $this->state =
'beforeDoctypeName';
909 $this->state =
'beforeDoctypeName';
◆ doctypeState() [2/2]
Definition at line 1321 of file PH5P.php.
1327 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1328 $this->state =
'beforeDoctypeName';
1332 $this->state =
'beforeDoctypeName';
◆ emitToken() [1/2]
HTML5::emitToken |
( |
|
$token | ) |
|
|
private |
Definition at line 1121 of file PH5P.php.
References $token.
1123 $emit = $this->tree->emitToken(
$token);
1126 $this->content_model = $emit;
1128 } elseif(
$token[
'type'] === self::ENDTAG) {
1129 $this->content_model = self::PCDATA;
◆ emitToken() [2/2]
HTML5::emitToken |
( |
|
$token | ) |
|
|
private |
Definition at line 1553 of file PH5P.php.
Referenced by afterAttributeNameState(), afterDoctypeNameState(), attributeNameState(), attributeValueDoubleQuotedState(), attributeValueSingleQuotedState(), attributeValueUnquotedState(), beforeAttributeNameState(), beforeAttributeValueState(), beforeDoctypeNameState(), bogusCommentState(), bogusDoctypeState(), closeTagOpenState(), commentDashState(), commentEndState(), commentState(), dataState(), doctypeNameState(), entityDataState(), entityInAttributeValueState(), HTML5TreeConstructer\inBody(), tagNameState(), and tagOpenState().
1555 $emit = $this->tree->emitToken(
$token);
1557 if (is_int($emit)) {
1558 $this->content_model = $emit;
1560 } elseif (
$token[
'type'] === self::ENDTAG) {
1561 $this->content_model = self::PCDATA;
◆ entity() [1/2]
Definition at line 1035 of file PH5P.php.
References $char, $start, character(), and characters().
1045 switch($this->
character($this->
char + 1)) {
1051 switch($this->
character($this->
char + 1)) {
1063 $char_class =
'0-9A-Fa-f';
1072 $char_class =
'0-9';
1081 $cond = strlen($e_name) > 0;
1091 $e_name = $this->
characters(
'0-9A-Za-z;', $this->
char + 1);
1092 $len = strlen($e_name);
1094 for($c = 1; $c <= $len; $c++) {
1095 $id = substr($e_name, 0, $c);
1098 if(in_array($id, $this->entities)) {
1104 $cond = isset($entity);
1118 return html_entity_decode(
'&'.$entity.
';', ENT_QUOTES,
'UTF-8');
characters($char_class, $start)
◆ entity() [2/2]
Definition at line 1462 of file PH5P.php.
References $start.
Referenced by entityDataState(), and entityInAttributeValueState().
1472 switch ($this->
character($this->
char + 1)) {
1478 switch ($this->
character($this->
char + 1)) {
1490 $char_class =
'0-9A-Fa-f';
1499 $char_class =
'0-9';
1508 $cond = strlen($e_name) > 0;
1518 $e_name = $this->
characters(
'0-9A-Za-z;', $this->
char + 1);
1519 $len = strlen($e_name);
1521 for ($c = 1; $c <= $len; $c++) {
1522 $id = substr($e_name, 0, $c);
1525 if (in_array($id, $this->entities)) {
1526 if ($e_name[$c - 1] !==
';') {
1527 if ($c < $len && $e_name[$c] ==
';') {
1536 $cond = isset($entity);
1550 return html_entity_decode(
'&' . $entity .
';', ENT_QUOTES,
'UTF-8');
characters($char_class, $start)
◆ entityDataState() [1/2]
HTML5::entityDataState |
( |
| ) |
|
|
private |
◆ entityDataState() [2/2]
HTML5::entityDataState |
( |
| ) |
|
|
private |
Definition at line 616 of file PH5P.php.
References array.
619 $entity = $this->
entity();
623 $char = (!$entity) ?
'&' : $entity;
626 'type' => self::CHARACTR,
632 $this->state =
'data';
Create styles array
The data for the language used.
◆ entityInAttributeValueState() [1/2]
HTML5::entityInAttributeValueState |
( |
| ) |
|
|
private |
◆ entityInAttributeValueState() [2/2]
HTML5::entityInAttributeValueState |
( |
| ) |
|
|
private |
◆ EOF() [1/2]
Definition at line 1133 of file PH5P.php.
References array, and EOF.
1135 $this->state = null;
1136 $this->tree->emitToken(
array(
Create styles array
The data for the language used.
const EOF
How fgetc() reports an End Of File.
◆ EOF() [2/2]
Definition at line 1565 of file PH5P.php.
References array, and EOF.
Referenced by __construct(), afterAttributeNameState(), afterDoctypeNameState(), attributeNameState(), attributeValueDoubleQuotedState(), attributeValueSingleQuotedState(), beforeAttributeNameState(), beforeDoctypeNameState(), bogusCommentState(), bogusDoctypeState(), char(), character(), closeTagOpenState(), commentDashState(), commentEndState(), commentState(), dataState(), doctypeNameState(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\mainPhase(), HTML5TreeConstructer\rootElementPhase(), tagNameState(), and HTML5TreeConstructer\trailingEndPhase().
1567 $this->state = null;
1568 $this->tree->emitToken(
Create styles array
The data for the language used.
const EOF
How fgetc() reports an End Of File.
◆ markupDeclarationOpenState() [1/2]
HTML5::markupDeclarationOpenState |
( |
| ) |
|
|
private |
Definition at line 790 of file PH5P.php.
References array, and character().
795 if($this->
character($this->
char + 1, 2) ===
'--') {
797 $this->state =
'comment';
798 $this->token =
array(
800 'type' => self::COMMENT
806 } elseif(strtolower($this->
character($this->
char + 1, 7)) ===
'doctype') {
808 $this->state =
'doctype';
815 $this->state =
'bogusComment';
Create styles array
The data for the language used.
◆ markupDeclarationOpenState() [2/2]
HTML5::markupDeclarationOpenState |
( |
| ) |
|
|
private |
Definition at line 1213 of file PH5P.php.
References array.
1218 if ($this->
character($this->
char + 1, 2) ===
'--') {
1220 $this->state =
'comment';
1221 $this->token =
array(
1223 'type' => self::COMMENT
1229 } elseif (strtolower($this->
character($this->
char + 1, 7)) ===
'doctype') {
1231 $this->state =
'doctype';
1238 $this->state =
'bogusComment';
Create styles array
The data for the language used.
◆ save() [1/2]
Definition at line 85 of file PH5P.php.
87 return $this->tree->save();
◆ save() [2/2]
Definition at line 476 of file PH5P.php.
478 return $this->tree->save();
◆ tagNameState() [1/2]
Definition at line 388 of file PH5P.php.
References $char, character(), emitToken(), and EOF().
394 if(preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
401 $this->state =
'beforeAttributeName';
403 } elseif(
$char ===
'>') {
407 $this->state =
'data';
409 } elseif($this->
char === $this->
EOF) {
416 $this->state =
'data';
418 } elseif(
$char ===
'/') {
422 $this->state =
'beforeAttributeName';
428 $this->token[
'name'] .= strtolower(
$char);
429 $this->state =
'tagName';
◆ tagNameState() [2/2]
Definition at line 808 of file PH5P.php.
References EOF.
814 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
821 $this->state =
'beforeAttributeName';
823 } elseif (
$char ===
'>') {
827 $this->state =
'data';
829 } elseif ($this->
char === $this->
EOF) {
836 $this->state =
'data';
838 } elseif (
$char ===
'/') {
842 $this->state =
'beforeAttributeName';
848 $this->token[
'name'] .= strtolower(
$char);
849 $this->state =
'tagName';
◆ tagOpenState() [1/2]
Definition at line 228 of file PH5P.php.
References $char, array, char(), character(), and emitToken().
230 switch($this->content_model) {
238 if($this->
character($this->
char + 1) ===
'/') {
240 $this->state =
'closeTagOpen';
244 'type' => self::CHARACTR,
248 $this->state =
'data';
261 $this->state =
'markupDeclarationOpen';
263 } elseif(
$char ===
'/') {
266 $this->state =
'closeTagOpen';
268 } elseif(preg_match(
'/^[A-Za-z]$/',
$char)) {
274 $this->token =
array(
275 'name' => strtolower(
$char),
276 'type' => self::STARTTAG,
280 $this->state =
'tagName';
282 } elseif(
$char ===
'>') {
287 'type' => self::CHARACTR,
291 $this->state =
'data';
293 } elseif(
$char ===
'?') {
296 $this->state =
'bogusComment';
303 'type' => self::CHARACTR,
308 $this->state =
'data';
Create styles array
The data for the language used.
◆ tagOpenState() [2/2]
Definition at line 635 of file PH5P.php.
References array.
637 switch ($this->content_model) {
645 if ($this->
character($this->
char + 1) ===
'/') {
647 $this->state =
'closeTagOpen';
652 'type' => self::CHARACTR,
657 $this->state =
'data';
670 $this->state =
'markupDeclarationOpen';
672 } elseif (
$char ===
'/') {
675 $this->state =
'closeTagOpen';
677 } elseif (preg_match(
'/^[A-Za-z]$/',
$char)) {
683 $this->token =
array(
684 'name' => strtolower(
$char),
685 'type' => self::STARTTAG,
689 $this->state =
'tagName';
691 } elseif (
$char ===
'>') {
697 'type' => self::CHARACTR,
702 $this->state =
'data';
704 } elseif (
$char ===
'?') {
707 $this->state =
'bogusComment';
715 'type' => self::CHARACTR,
721 $this->state =
'data';
Create styles array
The data for the language used.
◆ $char
Definition at line 73 of file PH5P.php.
Referenced by afterAttributeNameState(), afterDoctypeNameState(), attributeNameState(), attributeValueDoubleQuotedState(), attributeValueSingleQuotedState(), attributeValueUnquotedState(), beforeAttributeNameState(), beforeAttributeValueState(), beforeDoctypeNameState(), bogusDoctypeState(), char(), closeTagOpenState(), commentDashState(), commentEndState(), commentState(), dataState(), doctypeNameState(), doctypeState(), entity(), entityDataState(), entityInAttributeValueState(), tagNameState(), and tagOpenState().
◆ $content_model
◆ $data
◆ $entities
◆ $EOF
◆ $escape
◆ $state
◆ $token
Definition at line 77 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), emitToken(), HTML5TreeConstructer\emitToken(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inCaption(), HTML5TreeConstructer\inCell(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inRow(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\insertElement(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\inTableBody(), HTML5TreeConstructer\mainPhase(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ $tree
◆ CDATA
◆ CHARACTR
const HTML5::CHARACTR = 4 |
Definition at line 458 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ COMMENT
Definition at line 457 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ DOCTYPE
◆ ENDTAG
Definition at line 456 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\closeCell(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inCaption(), HTML5TreeConstructer\inCell(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inRow(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\inTableBody(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ EOF
◆ PCDATA
◆ PLAINTEXT
const HTML5::PLAINTEXT = 3 |
◆ RCDATA
◆ STARTTAG
const HTML5::STARTTAG = 1 |
Definition at line 455 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inCaption(), HTML5TreeConstructer\inCell(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inRow(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\inTableBody(), HTML5TreeConstructer\mainPhase(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php