Feat: pas de balises li et br pour la version CSV
This commit is contained in:
parent
c9a1a1b36c
commit
6fee512f80
2 changed files with 22 additions and 7 deletions
|
@ -330,7 +330,7 @@ function recup_liens_int($html) {
|
||||||
foreach($match as $m) {
|
foreach($match as $m) {
|
||||||
$m[7] = preg_replace('/<(img|(\/)?span)[^>]*>/si', '', $m[7]);
|
$m[7] = preg_replace('/<(img|(\/)?span)[^>]*>/si', '', $m[7]);
|
||||||
// liens exclus
|
// liens exclus
|
||||||
if(in_array($m[3], $url_exclus) || str_contains($m[3], '#comment') || str_contains($m[3], '/user/') || in_array($m[7], $txt_exclus) || str_replace([' ', ' '], '', $m[7]) === '') {
|
if(in_array($m[3], $url_exclus) || str_contains($m[3], '#comment') || str_contains($m[3], '/user/') || str_contains($m[3], '/members/') || str_contains($m[3], '/subscription/') || in_array($m[7], $txt_exclus) || str_replace([' ', ' '], '', $m[7]) === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!array_key_exists($m[3], $liens_int)) {
|
if (!array_key_exists($m[3], $liens_int)) {
|
||||||
|
@ -347,3 +347,18 @@ function recup_liens_int($html) {
|
||||||
|
|
||||||
return count($l_int) ? "<ul><li>".join("</li><li>", $l_int)."</li></ul>" : '';
|
return count($l_int) ? "<ul><li>".join("</li><li>", $l_int)."</li></ul>" : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sans_li($html) {
|
||||||
|
$html = str_replace(['<ul>', '</ul>', '<li>'], '', $html);
|
||||||
|
$html = str_replace('</li>', "\r\n", $html);
|
||||||
|
$html = str_replace(' ', " ", $html);
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sans_br($html) {
|
||||||
|
$html = str_replace('<br>', "\r\n", $html);
|
||||||
|
$html = str_replace(' ', " ", $html);
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
|
@ -94,12 +94,12 @@
|
||||||
"title": [(#GET{title}|json_encode)],
|
"title": [(#GET{title}|json_encode)],
|
||||||
"desc": [(#GET{description}|json_encode)],
|
"desc": [(#GET{description}|json_encode)],
|
||||||
"keywords": [(#GET{keywords}|json_encode)],
|
"keywords": [(#GET{keywords}|json_encode)],
|
||||||
"trackers": [(#GET{trackers}|json_encode)],
|
"trackers": [(#GET{trackers}|sans_li|json_encode)],
|
||||||
"rezos": [(#GET{rezos}|json_encode)],
|
"rezos": [(#GET{rezos}|sans_li|json_encode)],
|
||||||
"titres": [(#GET{titres}|json_encode)],
|
"titres": [(#GET{titres}|sans_li|json_encode)],
|
||||||
"liens_ext": [(#GET{liens_ext}|json_encode)],
|
"liens_ext": [(#GET{liens_ext}|sans_li|json_encode)],
|
||||||
"liens_int": [(#GET{liens_int}|json_encode)],
|
"liens_int": [(#GET{liens_int}|sans_li|json_encode)],
|
||||||
"text": [(#GET{text}|json_encode)]
|
"text": [(#GET{text}sans_br|json_encode)]
|
||||||
}
|
}
|
||||||
} [(#SET{id_jsonl, #GET{id_jsonl}|plus{1}})]
|
} [(#SET{id_jsonl, #GET{id_jsonl}|plus{1}})]
|
||||||
</BOUCLE_2lignes>
|
</BOUCLE_2lignes>
|
||||||
|
|
Loading…
Add table
Reference in a new issue