kopia lustrzana https://github.com/nextcloud/social
preserve some of the whitespace from html tags
without the "html whitespace" a hashtag posted after a url will be seen as part of the link by linkify, and then mangled by the hashtagmangler and break the url. additionally this keeps the appearance of the post closer to the original Signed-off-by: Robin Appelman <robin@icewind.nl>pull/1028/head
rodzic
ab2379013a
commit
ce1484f1b0
|
@ -557,10 +557,14 @@ class ACore extends Item implements JsonSerializable {
|
|||
return $value;
|
||||
|
||||
case self::AS_STRING:
|
||||
// try to preserve some whitespace from the html tags
|
||||
$value = preg_replace("/\<br *\/?\>/", "\n", $value);
|
||||
$value = preg_replace("/\<\/?p>/", "\n", $value);
|
||||
|
||||
$value = strip_tags($value);
|
||||
$value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5);
|
||||
|
||||
return $value;
|
||||
return trim($value);
|
||||
|
||||
case self::AS_USERNAME:
|
||||
$value = strip_tags($value);
|
||||
|
|
Ładowanie…
Reference in New Issue