Changeset View
Changeset View
Standalone View
Standalone View
src/parser/html/PhutilDOMNode.php
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | foreach ($this->getChildren() as $child) { | ||||
continue; | continue; | ||||
} | } | ||||
// Otherwise, this is some other tag. Convert it into a content | // Otherwise, this is some other tag. Convert it into a content | ||||
// node. | // node. | ||||
$raw_string = $child->newRawString(); | $raw_string = $child->newRawString(); | ||||
$nodes[] = id(new self()) | $nodes[] = (new self()) | ||||
->setContent($raw_string) | ->setContent($raw_string) | ||||
->setRawHead($raw_string); | ->setRawHead($raw_string); | ||||
} | } | ||||
return $this->mergeContentNodes($nodes); | return $this->mergeContentNodes($nodes); | ||||
} | } | ||||
public function newRawContentString() { | public function newRawContentString() { | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | foreach ($list as $item) { | ||||
$parts[] = $content_node->newRawString(); | $parts[] = $content_node->newRawString(); | ||||
} | } | ||||
$parts = implode('', $parts); | $parts = implode('', $parts); | ||||
if (!strlen($parts)) { | if (!strlen($parts)) { | ||||
continue; | continue; | ||||
} | } | ||||
$results[] = id(new self()) | $results[] = (new self()) | ||||
->setContent($parts) | ->setContent($parts) | ||||
->setRawHead($parts); | ->setRawHead($parts); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0