namespace Cubist\Util\Animations;
+use Cubist\Util\Text;
use DOMDocument;
use DOMElement;
use DOMXPath;
$unz = self::unzipOAM($src, null, 'zip');
$index = $unz . '/index.html';
if (file_exists($index)) {
- $c = file_get_contents($index);
+ $c = Text::normalizeLines(file_get_contents($index));
$res['html'] = $c;
if (stripos($c, '<div id="lottie"></div>') !== false) {
preg_match('/var animationData = (\{.*\})/', $c, $m);
- $ad = json_decode(trim($m[1]), true);
+ $content = trim($m[1]);
+ $ad = json_decode($content, true);
$res['width'] = $ad['w'];
$res['height'] = $ad['h'];
} else {