public function autoEmbed($body = null)
{
if (!is_string($body)) {
$this->errors[] = 'For auto-embedding purposes, the input must be a string';
} elseif ($data = $this->getUrlInfo($body)) {
$table = array();
foreach ($data as $url => $service) {
if (!empty($service['html'])) {
$table[$url] = $service['html'];
}
}
// Determine wether the body looks like HTML or just plain text.
if (strpos($body, '>') !== false) {
$processor = new \Embera\HtmlProcessor($this->config['ignore_tags'], $table);
return $processor->process($body);
}
return strtr($body, $table);
}
return $body;
}