mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-11-25 15:56:09 +01:00
[TASK][SECURITY][!!!] Update to mjml 4 due to security npm issues
* [TASK][SECURITY][!!!] Update to mjml 4 due to security npm issues * WIP|TASK: Fix broken test Fix error in test. Still the expected HTML is not as returned from mjml. * [TASK] Remove comment generated by the consoleOutput in the test * [TASK] Modify Expected.html to fit generated entry * [TASK] Add same conversions on both outputs * [TASK] Try with phpunit assertStringEqualsFile function * [TASK] remove the \n again * [BUGFIX] Add some compression configs to keep it small * [BUGFIX] reduce line length
This commit is contained in:
parent
543fbba727
commit
d1a97b9be8
7 changed files with 70 additions and 2925 deletions
|
@ -9,15 +9,17 @@ class Command implements RendererInterface
|
||||||
{
|
{
|
||||||
public function getHtmlFromMjml($mjml)
|
public function getHtmlFromMjml($mjml)
|
||||||
{
|
{
|
||||||
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mjml']);
|
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mjml']);
|
||||||
|
|
||||||
$temporaryMjmlFileWithPath = GeneralUtility::tempnam('mjml_', '.mjml');
|
$temporaryMjmlFileWithPath = GeneralUtility::tempnam('mjml_', '.mjml');
|
||||||
|
|
||||||
GeneralUtility::writeFileToTypo3tempDir($temporaryMjmlFileWithPath, $mjml);
|
GeneralUtility::writeFileToTypo3tempDir($temporaryMjmlFileWithPath, $mjml);
|
||||||
|
|
||||||
|
$mjmlExtPath = ExtensionManagementUtility::extPath('mjml');
|
||||||
|
|
||||||
// see https://mjml.io/download and https://www.npmjs.com/package/mjml-cli
|
// see https://mjml.io/download and https://www.npmjs.com/package/mjml-cli
|
||||||
$cmd = $configuration['nodeBinaryPath'] . ' ' . ExtensionManagementUtility::extPath('mjml') . $configuration['mjmlBinaryPath'] . $configuration['mjmlBinary'];
|
$cmd = $conf['nodeBinaryPath'] . ' ' . $mjmlExtPath . $conf['mjmlBinaryPath'] . $conf['mjmlBinary'];
|
||||||
$args = $configuration['mjmlParams'] . ' ' . $temporaryMjmlFileWithPath;
|
$args = $temporaryMjmlFileWithPath . ' ' . $conf['mjmlParams'];
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
$returnValue = '';
|
$returnValue = '';
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,23 +9,21 @@ class MjmlBasedViewTest extends AbstractUnitTestCase
|
||||||
{
|
{
|
||||||
public const EXAMPLE_MJML_TEMPLATE = '<mjml>
|
public const EXAMPLE_MJML_TEMPLATE = '<mjml>
|
||||||
<mj-body>
|
<mj-body>
|
||||||
<mj-container>
|
<mj-section>
|
||||||
<mj-section>
|
<mj-column>
|
||||||
<mj-column>
|
<mj-image src="/assets/img/easy-and-quick.png" width="112px" />
|
||||||
<mj-image src="/assets/img/easy-and-quick.png" width="112" />
|
<mj-text font-size="20px" color="#595959" align="center">Easy and Quick</mj-text>
|
||||||
<mj-text font-size="20px" color="#595959" align="center">Easy and Quick</mj-text>
|
</mj-column>
|
||||||
</mj-column>
|
<mj-column>
|
||||||
<mj-column>
|
<mj-image src="/assets/img/responsive.png" width="135px" />
|
||||||
<mj-image src="/assets/img/responsive.png" width="135" />
|
<mj-text font-size="20px" color="#595959" align="center">Responsive</mj-text>
|
||||||
<mj-text font-size="20px" color="#595959" align="center">Responsive</mj-text>
|
</mj-column>
|
||||||
</mj-column>
|
</mj-section>
|
||||||
</mj-section>
|
<mj-section>
|
||||||
<mj-section>
|
<mj-column>
|
||||||
<mj-column>
|
<mj-button background-color="#F45E43" font-size="15px">Discover</mj-button>
|
||||||
<mj-button background-color="#F45E43" font-size="15px">Discover</mj-button>
|
</mj-column>
|
||||||
</mj-column>
|
</mj-section>
|
||||||
</mj-section>
|
|
||||||
</mj-container>
|
|
||||||
</mj-body>
|
</mj-body>
|
||||||
</mjml>
|
</mjml>
|
||||||
';
|
';
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# cat=node/Binary/1000; type=string; label=Path to node binary : /usr/bin/node
|
# cat=node/Binary/1000; type=string; label=Path to node binary : /usr/bin/node
|
||||||
nodeBinaryPath = /usr/bin/node
|
nodeBinaryPath = /usr/bin/node
|
||||||
|
|
||||||
# cat=mjml/Binary/2000; type=string; label=Path to mjml binary in mjml EXT folder : ./node_modules/.bin/
|
# cat=mjml/Binary/2000; type=string; label=Path to mjml binary in mjml EXT folder : ./node_modules/mjml/bin/
|
||||||
mjmlBinaryPath = ./node_modules/.bin/
|
mjmlBinaryPath = ./node_modules/mjml/bin/
|
||||||
|
|
||||||
# cat=mjml/Binary/3000; type=string; label=mjml binary : mjml
|
# cat=mjml/Binary/3000; type=string; label=mjml binary : mjml
|
||||||
mjmlBinary = mjml
|
mjmlBinary = mjml
|
||||||
|
|
||||||
# cat=mjml/Binary/4000; type=string; label=mjml params : -s -m
|
# cat=mjml/Binary/4000; type=string; label=mjml params : -s --config.beautify true --config.minify true
|
||||||
mjmlParams = -s -m
|
mjmlParams = -s --config.beautify true --config.minify true
|
||||||
|
|
2878
package-lock.json
generated
2878
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mjml-typo3",
|
"name": "mjml-typo3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mjml": "^3.3.5"
|
"mjml": "^4.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue