// check self closing
if ($this->copy_until_char_escape('>')==='https://www.jb51.net/') {
$node->_[HDOM_INFO_ENDSPACE] .= 'https://www.jb51.net/';
$node->_[HDOM_INFO_END] = 0;
}
else {
// reset parent
if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node;
}
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
return true;
}
// parse attributes
protected function parse_attr($node, $name, &$space) {
$space[2] = $this->copy_skip($this->token_blank);
switch($this->char) {
case '"':
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
break;
case '\'':
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
break;
default:
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
$node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
}
}
// link node's parent
protected function link_nodes(&$node, $is_child) {
$node->parent = $this->parent;
$this->parent->nodes[] = $node;
if ($is_child)
$this->parent->children[] = $node;
}
// as a text node
protected function as_text_node($tag) {
$node = new simple_html_dom_node($this);
++$this->cursor;
$node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
$this->link_nodes($node, false);
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
return true;
}