Merge pull request #753 from zotlabs/mdauto
markdown autolinks - hubzilla bug #752
This commit is contained in:
commit
f08001a5a6
@ -77,15 +77,22 @@ class MarkdownSoap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function purify($s) {
|
function purify($s) {
|
||||||
// $s = str_replace("\n",'<br>',$s);
|
$s = $this->protect_autolinks($s);
|
||||||
// $s = str_replace("\t",' ',$s);
|
|
||||||
// $s = str_replace(' ',' ',$s);
|
|
||||||
$s = purify_html($s);
|
$s = purify_html($s);
|
||||||
// $s = str_replace([' ', mb_convert_encoding(' ','UTF-8','HTML-ENTITIES')], [ ' ', ' ' ],$s);
|
$s = $this->unprotect_autolinks($s);
|
||||||
// $s = str_replace(['<br>','<br />', '<', '>' ],["\n","\n", '<', '>'],$s);
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function protect_autolinks($s) {
|
||||||
|
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/','[$1$2]($1$2)',$s);
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function unprotect_autolinks($s) {
|
||||||
|
return $s;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function escape($s) {
|
function escape($s) {
|
||||||
return htmlspecialchars($s,ENT_QUOTES);
|
return htmlspecialchars($s,ENT_QUOTES);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user