From 1cfb8c02a07681e3f10459b085c00e6304602f33 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 7 Aug 2016 13:02:10 +0200 Subject: [PATCH] [Wikipedia] Use entire entry as title for 'Did you know' --- bridges/WikipediaBridge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridges/WikipediaBridge.php b/bridges/WikipediaBridge.php index 8434c8e..535b11a 100644 --- a/bridges/WikipediaBridge.php +++ b/bridges/WikipediaBridge.php @@ -191,8 +191,10 @@ class WikipediaBridge extends BridgeAbstract{ private function AddDidYouKnowGeneric($element, $fullArticle){ foreach($element->find('ul', 0)->find('li') as $entry){ $item = new \Item(); + + // We can only use the first anchor, there is no way of finding the 'correct' one if there are multiple $item->uri = $this->uri . $entry->find('a', 0)->href; - $item->title = $entry->find('a', 0)->title; + $item->title = strip_tags($entry->innertext); if(!$fullArticle) $item->content = $this->ReplaceURIInHTMLElement($entry);