mirror of
https://github.com/friendica/friendica
synced 2025-04-19 06:30:10 +00:00
New routines for markdown to html and html to markdown.
This commit is contained in:
parent
c8a1057300
commit
2f46675a89
9 changed files with 2368 additions and 2936 deletions
|
@ -168,6 +168,8 @@ function bb_remove_share_information($Text, $plaintext = false, $nolink = false)
|
|||
}
|
||||
|
||||
function bb_cleanup_share($shared, $plaintext, $nolink) {
|
||||
$shared[1] = trim($shared[1]);
|
||||
|
||||
if (!in_array($shared[2], array("type-link", "type-video")))
|
||||
return($shared[0]);
|
||||
|
||||
|
@ -178,7 +180,7 @@ function bb_cleanup_share($shared, $plaintext, $nolink) {
|
|||
return($shared[0]);
|
||||
|
||||
if ($nolink)
|
||||
return(trim($shared[1]));
|
||||
return($shared[1]);
|
||||
|
||||
$title = "";
|
||||
$link = "";
|
||||
|
@ -189,6 +191,9 @@ function bb_cleanup_share($shared, $plaintext, $nolink) {
|
|||
if (isset($bookmark[1][0]))
|
||||
$link = $bookmark[1][0];
|
||||
|
||||
if (($title != "") AND (strpos($title, $shared[1]) !== false))
|
||||
$shared[1] = $title;
|
||||
|
||||
if (($title != "") AND ((strpos($shared[1],$title) !== false) OR
|
||||
(similar_text($shared[1],$title) / strlen($title)) > 0.9))
|
||||
$title = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue