[RadioMelodieBridge] Fix article content (#3230)

- remove the social network share section ath the beginning and and the
  end of the article
- removte the HTML formated article tilthe from the content
- limite the author picture size to 60 px
This commit is contained in:
sysadminstory 2023-01-29 19:45:55 +01:00 committed by GitHub
parent b21806a0b3
commit 57e79e7f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,14 @@ class RadioMelodieBridge extends BridgeAbstract
$article = str_get_html($article->save());
$textDOM = $article->find('article', 0);
// Remove HTML code for the article title
$textDOM->find('h1', 0)->outertext = '';
// Fix the CSS for the author
$textDOM->find('div[class=author]', 0)->find('img', 0)
->setAttribute('style', 'width: 60px; margin: 0 15px; display: inline-block; vertical-align: top;');
// Initialise arrays
$item = [];
$audio = [];
@ -76,6 +84,7 @@ class RadioMelodieBridge extends BridgeAbstract
// Remove the share article part
$textDOM->find('div[class=share]', 0)->outertext = '';
$textDOM->find('div[class=share]', 1)->outertext = '';
// Rewrite relative Links
$textDOM = defaultLinkTo($textDOM, self::URI . '/');