3
1
Back

Voices; based heavily on Moritz Klein's work, but with an alt or title tag. Function alt_textify($article, $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { $article['content'] .= "" . $entry->ownerDocument->saveXML($entry) . "

"; } } // Something Positive $alt_text = trim($entry->getAttribute('alt')); $alt_text = trim($img->getAttribute('title')); if (!$alt_text) { $new_element = $doc->createElement("img"); $new_element->setAttribute('src', $extraimage->getAttribute('src')); $bread->parentNode->replaceChild($new_element, $bread); $article['content'] = $doc->saveHTML(); elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { $article['content'] .= "ID: " . $img->getAttribute('title') . ""; $img_tag = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'png')]", $article.

New Pull Request