Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Use lorenzo/pinky Inky transplier (breaks compatibility with PHP < 5.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi authored and gremo committed Aug 2, 2018
1 parent cf655b9 commit f3139b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}
],
"require": {
"php": "^5.3.2 || ^7.0",
"hampe/inky": "^1.3.6",
"php": "^5.6.0 || ^7.0",
"lorenzo/pinky":"1.0.1",
"symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0",
"tijsverkoyen/css-to-inline-styles": "^1.5 || ^2.0",
"twig/twig": "^1.23 || ^2.0"
Expand Down
3 changes: 0 additions & 3 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<argument type="service">
<service class="TijsVerkoyen\CssToInlineStyles\CssToInlineStyles" />
</argument>
<argument type="service">
<service class="Hampe\Inky\Inky" />
</argument>
</service>
<service id="gremo_zurb_ink.twig_extension" class="Gremo\ZurbInkBundle\Twig\GremoZurbInkExtension" public="false">
<tag name="twig.extension" />
Expand Down
8 changes: 3 additions & 5 deletions src/Util/HtmlUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@

namespace Gremo\ZurbInkBundle\Util;

use Hampe\Inky\Inky;
use Pinky;
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

class HtmlUtils
{
private $cssToInlineStyles;
private $inky;

public function __construct(CssToInlineStyles $cssToInlineStyles, Inky $inky)
public function __construct(CssToInlineStyles $cssToInlineStyles)
{
$this->cssToInlineStyles = $cssToInlineStyles;
$this->inky = $inky;
}

/**
Expand Down Expand Up @@ -57,6 +55,6 @@ public function inlineCss($html, $css)
*/
public function parseInky($content)
{
return $this->inky->releaseTheKraken($content);
return Pinky\transformString($content)->saveHTML();
}
}

0 comments on commit f3139b6

Please sign in to comment.