API: Support for entitites. (embedded pictures in twidere)

This commit is contained in:
Michael Vogel 2014-02-02 09:54:33 +01:00
parent 2be9e2f246
commit 738d7a221e
3 changed files with 164 additions and 17 deletions

View file

@ -191,9 +191,9 @@ function html2plain($html, $wraplength = 75, $compact = false)
//node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array(), '', '');
if (!$compact)
node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]');
node2bbcode($doc, 'img', array('src'=>'/(.+)/'), ' [img]$1', '[/img] ');
else
node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '', '');
node2bbcode($doc, 'img', array('src'=>'/(.+)/'), ' ', ' ');
node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), ' $1 ', '', true);