|
@@ 686-719 (lines=34) @@
|
| 683 |
|
} |
| 684 |
|
} |
| 685 |
|
|
| 686 |
|
private function attributeValueDoubleQuotedState() { |
| 687 |
|
// Consume the next input character: |
| 688 |
|
$this->char++; |
| 689 |
|
$char = $this->character($this->char); |
| 690 |
|
|
| 691 |
|
if($char === '"') { |
| 692 |
|
/* U+0022 QUOTATION MARK (") |
| 693 |
|
Switch to the before attribute name state. */ |
| 694 |
|
$this->state = 'beforeAttributeName'; |
| 695 |
|
|
| 696 |
|
} elseif($char === '&') { |
| 697 |
|
/* U+0026 AMPERSAND (&) |
| 698 |
|
Switch to the entity in attribute value state. */ |
| 699 |
|
$this->entityInAttributeValueState('double'); |
| 700 |
|
|
| 701 |
|
} elseif($this->char === $this->EOF) { |
| 702 |
|
/* EOF |
| 703 |
|
Parse error. Emit the current tag token. Reconsume the character |
| 704 |
|
in the data state. */ |
| 705 |
|
$this->emitToken($this->token); |
| 706 |
|
|
| 707 |
|
$this->char--; |
| 708 |
|
$this->state = 'data'; |
| 709 |
|
|
| 710 |
|
} else { |
| 711 |
|
/* Anything else |
| 712 |
|
Append the current input character to the current attribute's value. |
| 713 |
|
Stay in the attribute value (double-quoted) state. */ |
| 714 |
|
$last = count($this->token['attr']) - 1; |
| 715 |
|
$this->token['attr'][$last]['value'] .= $char; |
| 716 |
|
|
| 717 |
|
$this->state = 'attributeValueDoubleQuoted'; |
| 718 |
|
} |
| 719 |
|
} |
| 720 |
|
|
| 721 |
|
private function attributeValueSingleQuotedState() { |
| 722 |
|
// Consume the next input character: |
|
@@ 721-754 (lines=34) @@
|
| 718 |
|
} |
| 719 |
|
} |
| 720 |
|
|
| 721 |
|
private function attributeValueSingleQuotedState() { |
| 722 |
|
// Consume the next input character: |
| 723 |
|
$this->char++; |
| 724 |
|
$char = $this->character($this->char); |
| 725 |
|
|
| 726 |
|
if($char === '\'') { |
| 727 |
|
/* U+0022 QUOTATION MARK (') |
| 728 |
|
Switch to the before attribute name state. */ |
| 729 |
|
$this->state = 'beforeAttributeName'; |
| 730 |
|
|
| 731 |
|
} elseif($char === '&') { |
| 732 |
|
/* U+0026 AMPERSAND (&) |
| 733 |
|
Switch to the entity in attribute value state. */ |
| 734 |
|
$this->entityInAttributeValueState('single'); |
| 735 |
|
|
| 736 |
|
} elseif($this->char === $this->EOF) { |
| 737 |
|
/* EOF |
| 738 |
|
Parse error. Emit the current tag token. Reconsume the character |
| 739 |
|
in the data state. */ |
| 740 |
|
$this->emitToken($this->token); |
| 741 |
|
|
| 742 |
|
$this->char--; |
| 743 |
|
$this->state = 'data'; |
| 744 |
|
|
| 745 |
|
} else { |
| 746 |
|
/* Anything else |
| 747 |
|
Append the current input character to the current attribute's value. |
| 748 |
|
Stay in the attribute value (single-quoted) state. */ |
| 749 |
|
$last = count($this->token['attr']) - 1; |
| 750 |
|
$this->token['attr'][$last]['value'] .= $char; |
| 751 |
|
|
| 752 |
|
$this->state = 'attributeValueSingleQuoted'; |
| 753 |
|
} |
| 754 |
|
} |
| 755 |
|
|
| 756 |
|
private function attributeValueUnquotedState() { |
| 757 |
|
// Consume the next input character: |