aboutsummaryrefslogtreecommitdiffstats
path: root/include/html2plain.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-06 11:05:22 +0000
committerMario <mario@mariovavti.com>2024-07-06 11:05:22 +0000
commit45275910e606a02b12393714ea3b0409da440d61 (patch)
tree10b2d173d58cb930f8df28fe75af73dd4974c08c /include/html2plain.php
parent0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff)
parentc04e781926a78e514cdf211fa24930a331149072 (diff)
downloadvolse-hubzilla-master.tar.gz
volse-hubzilla-master.tar.bz2
volse-hubzilla-master.zip
Merge branch '9.2RC'master
Diffstat (limited to 'include/html2plain.php')
-rw-r--r--include/html2plain.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/html2plain.php b/include/html2plain.php
index 5cb7ee35d..69fb5193a 100644
--- a/include/html2plain.php
+++ b/include/html2plain.php
@@ -129,6 +129,8 @@ function html2plain($html, $wraplength = 75, $compact = false)
if(!$message)
return;
+ $message = preg_replace('/\<li(.*?)\>/', "\n*", $message);
+ $message = str_replace('</li>', '', $message);
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
@@ -178,7 +180,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
//node2bbcode($doc, 'ul', array(), "\n[list]", "[/list]\n");
//node2bbcode($doc, 'ol', array(), "\n[list=1]", "[/list]\n");
- node2bbcode($doc, 'li', array(), "\n* ", "\n");
+ //node2bbcode($doc, 'li', array(), "\n* ", "\n");
node2bbcode($doc, 'hr', array(), "\n".str_repeat("-", 70)."\n", "");
@@ -194,7 +196,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
// Problem: there is no reliable way to detect if it is a link to a tag or profile
//node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1 ', '', true);
- node2bbcode($doc, 'a', array('href'=>'/(.+)/', 'rel'=>'oembed'), ' $1 ', '', true);
+ node2bbcode($doc, 'a', array('href'=>'/(.+)/', 'rel'=>'oembed'), ' $1 ', '');
//node2bbcode($doc, 'img', array('alt'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array(), '', '');
@@ -203,7 +205,7 @@ function html2plain($html, $wraplength = 75, $compact = false)
else
node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '', '');
- node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), ' $1 ', '', true);
+ node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), ' $1 ', '');
$message = $doc->saveHTML();