Skip to content

Commit

Permalink
Fix: WC item meta style issue when using dd. (#892)
Browse files Browse the repository at this point in the history
Fix: mPDF issue with `masterminds/html5` library
  • Loading branch information
alexmigf authored Oct 21, 2024
1 parent 1363b1a commit a848649
Show file tree
Hide file tree
Showing 237 changed files with 356 additions and 452 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"exclude_from_prefix": {
"packages": [
"symfony/polyfill-mbstring",
"symfony/polyfill-iconv"
"symfony/polyfill-iconv",
"masterminds/html5"
],
"namespaces": [],
"file_patterns": []
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions templates/Simple/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -231,29 +231,26 @@ table.notes-totals {
overflow-wrap: anywhere;
}

/* 'ul' applies to Dompdf only */
ul.wc-item-meta {
/* In Dompdf, '.wc-item-meta' is applied to a 'ul' element, whereas with the mPDF extension, it's a 'div' instead. For more details, refer to 'wpo_wcpdf_mpdf_modify_html()'. */
.wc-item-meta {
margin: 0;
}

ul.wc-item-meta li {
.wc-item-meta li {
margin-top: 4px;
margin-left: 0;
}

ul.wc-item-meta li p {
.wc-item-meta li p,
.wc-item-meta li dd {
display: inline;
}

/* with mPDF extension '.wc-item-meta' is not 'ul' but a 'div', see 'wpo_wcpdf_mpdf_modify_html()' */
div.wc-item-meta {
margin: 0;
}

/* this applies to both Dompdf and mPDF */
.wc-item-meta p,
.wc-item-meta dd,
.item-meta p {
margin-top: 4px;
margin-left: 0;
}

/* Notes & Totals */
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitda89efa14b410f6884f98183affb035a::getLoader();
return ComposerAutoloaderInit8da09a8f6b5e759115e893ca39030504::getLoader();
83 changes: 40 additions & 43 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,7 @@
$baseDir = dirname($vendorDir);

return array(
'ComposerAutoloaderInitda89efa14b410f6884f98183affb035a' => $vendorDir . '/composer/autoload_real.php',
'Composer\\Autoload\\ClassLoader' => $vendorDir . '/composer/ClassLoader.php',
'Composer\\Autoload\\ComposerStaticInitda89efa14b410f6884f98183affb035a' => $vendorDir . '/composer/autoload_static.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'WPO\\IPS\\Vendor\\Sabre\\Uri\\InvalidUriException' => $vendorDir . '/sabre/uri/lib/InvalidUriException.php',
'WPO\\IPS\\Vendor\\Sabre\\Uri\\Version' => $vendorDir . '/sabre/uri/lib/Version.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\ContextStackTrait' => $vendorDir . '/sabre/xml/lib/ContextStackTrait.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element' => $vendorDir . '/sabre/xml/lib/Element.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Base' => $vendorDir . '/sabre/xml/lib/Element/Base.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Cdata' => $vendorDir . '/sabre/xml/lib/Element/Cdata.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Elements' => $vendorDir . '/sabre/xml/lib/Element/Elements.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\KeyValue' => $vendorDir . '/sabre/xml/lib/Element/KeyValue.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Uri' => $vendorDir . '/sabre/xml/lib/Element/Uri.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\XmlFragment' => $vendorDir . '/sabre/xml/lib/Element/XmlFragment.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\LibXMLException' => $vendorDir . '/sabre/xml/lib/LibXMLException.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\ParseException' => $vendorDir . '/sabre/xml/lib/ParseException.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Reader' => $vendorDir . '/sabre/xml/lib/Reader.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Service' => $vendorDir . '/sabre/xml/lib/Service.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Version' => $vendorDir . '/sabre/xml/lib/Version.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Writer' => $vendorDir . '/sabre/xml/lib/Writer.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\XmlDeserializable' => $vendorDir . '/sabre/xml/lib/XmlDeserializable.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\XmlSerializable' => $vendorDir . '/sabre/xml/lib/XmlSerializable.php',
'Symfony\\Polyfill\\Iconv\\Iconv' => $vendorDir . '/symfony/polyfill-iconv/Iconv.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
'WPO\\IPS\\Vendor\\Dompdf\\Adapter\\CPDF' => $vendorDir . '/dompdf/dompdf/src/Adapter/CPDF.php',
'WPO\\IPS\\Vendor\\Dompdf\\Adapter\\GD' => $vendorDir . '/dompdf/dompdf/src/Adapter/GD.php',
'WPO\\IPS\\Vendor\\Dompdf\\Adapter\\PDFLib' => $vendorDir . '/dompdf/dompdf/src/Adapter/PDFLib.php',
Expand Down Expand Up @@ -148,26 +125,26 @@
'WPO\\IPS\\Vendor\\FontLib\\WOFF\\File' => $vendorDir . '/dompdf/php-font-lib/src/FontLib/WOFF/File.php',
'WPO\\IPS\\Vendor\\FontLib\\WOFF\\Header' => $vendorDir . '/dompdf/php-font-lib/src/FontLib/WOFF/Header.php',
'WPO\\IPS\\Vendor\\FontLib\\WOFF\\TableDirectoryEntry' => $vendorDir . '/dompdf/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5' => $vendorDir . '/masterminds/html5/src/HTML5.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Elements' => $vendorDir . '/masterminds/html5/src/HTML5/Elements.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Entities' => $vendorDir . '/masterminds/html5/src/HTML5/Entities.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Exception' => $vendorDir . '/masterminds/html5/src/HTML5/Exception.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\InstructionProcessor' => $vendorDir . '/masterminds/html5/src/HTML5/InstructionProcessor.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\CharacterReference' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/CharacterReference.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\DOMTreeBuilder' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\EventHandler' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/EventHandler.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\FileInputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/FileInputStream.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\InputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/InputStream.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\ParseError' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/ParseError.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\Scanner' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/Scanner.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\StringInputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/StringInputStream.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\Tokenizer' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/Tokenizer.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\TreeBuildingRules' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Parser\\UTF8Utils' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/UTF8Utils.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Serializer\\HTML5Entities' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/HTML5Entities.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Serializer\\OutputRules' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/OutputRules.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Serializer\\RulesInterface' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/RulesInterface.php',
'WPO\\IPS\\Vendor\\Masterminds\\HTML5\\Serializer\\Traverser' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/Traverser.php',
'Masterminds\\HTML5' => $vendorDir . '/masterminds/html5/src/HTML5.php',
'Masterminds\\HTML5\\Elements' => $vendorDir . '/masterminds/html5/src/HTML5/Elements.php',
'Masterminds\\HTML5\\Entities' => $vendorDir . '/masterminds/html5/src/HTML5/Entities.php',
'Masterminds\\HTML5\\Exception' => $vendorDir . '/masterminds/html5/src/HTML5/Exception.php',
'Masterminds\\HTML5\\InstructionProcessor' => $vendorDir . '/masterminds/html5/src/HTML5/InstructionProcessor.php',
'Masterminds\\HTML5\\Parser\\CharacterReference' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/CharacterReference.php',
'Masterminds\\HTML5\\Parser\\DOMTreeBuilder' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php',
'Masterminds\\HTML5\\Parser\\EventHandler' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/EventHandler.php',
'Masterminds\\HTML5\\Parser\\FileInputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/FileInputStream.php',
'Masterminds\\HTML5\\Parser\\InputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/InputStream.php',
'Masterminds\\HTML5\\Parser\\ParseError' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/ParseError.php',
'Masterminds\\HTML5\\Parser\\Scanner' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/Scanner.php',
'Masterminds\\HTML5\\Parser\\StringInputStream' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/StringInputStream.php',
'Masterminds\\HTML5\\Parser\\Tokenizer' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/Tokenizer.php',
'Masterminds\\HTML5\\Parser\\TreeBuildingRules' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php',
'Masterminds\\HTML5\\Parser\\UTF8Utils' => $vendorDir . '/masterminds/html5/src/HTML5/Parser/UTF8Utils.php',
'Masterminds\\HTML5\\Serializer\\HTML5Entities' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/HTML5Entities.php',
'Masterminds\\HTML5\\Serializer\\OutputRules' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/OutputRules.php',
'Masterminds\\HTML5\\Serializer\\RulesInterface' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/RulesInterface.php',
'Masterminds\\HTML5\\Serializer\\Traverser' => $vendorDir . '/masterminds/html5/src/HTML5/Serializer/Traverser.php',
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\CSSList\\AtRuleBlockList' => $vendorDir . '/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php',
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\CSSList\\CSSBlockList' => $vendorDir . '/sabberworm/php-css-parser/src/CSSList/CSSBlockList.php',
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\CSSList\\CSSList' => $vendorDir . '/sabberworm/php-css-parser/src/CSSList/CSSList.php',
Expand Down Expand Up @@ -208,6 +185,24 @@
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\Value\\URL' => $vendorDir . '/sabberworm/php-css-parser/src/Value/URL.php',
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\Value\\Value' => $vendorDir . '/sabberworm/php-css-parser/src/Value/Value.php',
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\Value\\ValueList' => $vendorDir . '/sabberworm/php-css-parser/src/Value/ValueList.php',
'WPO\\IPS\\Vendor\\Sabre\\Uri\\InvalidUriException' => $vendorDir . '/sabre/uri/lib/InvalidUriException.php',
'WPO\\IPS\\Vendor\\Sabre\\Uri\\Version' => $vendorDir . '/sabre/uri/lib/Version.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\ContextStackTrait' => $vendorDir . '/sabre/xml/lib/ContextStackTrait.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element' => $vendorDir . '/sabre/xml/lib/Element.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Base' => $vendorDir . '/sabre/xml/lib/Element/Base.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Cdata' => $vendorDir . '/sabre/xml/lib/Element/Cdata.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Elements' => $vendorDir . '/sabre/xml/lib/Element/Elements.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\KeyValue' => $vendorDir . '/sabre/xml/lib/Element/KeyValue.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\Uri' => $vendorDir . '/sabre/xml/lib/Element/Uri.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Element\\XmlFragment' => $vendorDir . '/sabre/xml/lib/Element/XmlFragment.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\LibXMLException' => $vendorDir . '/sabre/xml/lib/LibXMLException.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\ParseException' => $vendorDir . '/sabre/xml/lib/ParseException.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Reader' => $vendorDir . '/sabre/xml/lib/Reader.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Service' => $vendorDir . '/sabre/xml/lib/Service.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Version' => $vendorDir . '/sabre/xml/lib/Version.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\Writer' => $vendorDir . '/sabre/xml/lib/Writer.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\XmlDeserializable' => $vendorDir . '/sabre/xml/lib/XmlDeserializable.php',
'WPO\\IPS\\Vendor\\Sabre\\Xml\\XmlSerializable' => $vendorDir . '/sabre/xml/lib/XmlSerializable.php',
'WPO\\IPS\\Vendor\\Svg\\CssLength' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/CssLength.php',
'WPO\\IPS\\Vendor\\Svg\\DefaultStyle' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/DefaultStyle.php',
'WPO\\IPS\\Vendor\\Svg\\Document' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/Document.php',
Expand Down Expand Up @@ -237,4 +232,6 @@
'WPO\\IPS\\Vendor\\Svg\\Tag\\Symbol' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/Tag/Symbol.php',
'WPO\\IPS\\Vendor\\Svg\\Tag\\Text' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/Tag/Text.php',
'WPO\\IPS\\Vendor\\Svg\\Tag\\UseTag' => $vendorDir . '/dompdf/php-svg-lib/src/Svg/Tag/UseTag.php',
'Symfony\\Polyfill\\Iconv\\Iconv' => $vendorDir . '/symfony/polyfill-iconv/Iconv.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
);
8 changes: 4 additions & 4 deletions vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
'WPO\\IPS\\' => array($baseDir . '/includes'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Iconv\\' => array($vendorDir . '/symfony/polyfill-iconv'),
'Svg\\' => array($vendorDir . '/dompdf/php-svg-lib/src/Svg'),
'WPO\\IPS\\Vendor\\Svg\\' => array($vendorDir . '/dompdf/php-svg-lib/src/Svg'),
'WPO\\IPS\\Vendor\\Sabre\\Xml\\' => array($vendorDir . '/sabre/xml/lib'),
'WPO\\IPS\\Vendor\\Sabre\\Uri\\' => array($vendorDir . '/sabre/uri/lib'),
'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
'WPO\\IPS\\Vendor\\Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'),
'Masterminds\\' => array($vendorDir . '/masterminds/html5/src'),
'FontLib\\' => array($vendorDir . '/dompdf/php-font-lib/src/FontLib'),
'Dompdf\\' => array($vendorDir . '/dompdf/dompdf/src'),
'WPO\\IPS\\Vendor\\FontLib\\' => array($vendorDir . '/dompdf/php-font-lib/src/FontLib'),
'WPO\\IPS\\Vendor\\Dompdf\\' => array($vendorDir . '/dompdf/dompdf/src'),
);
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitda89efa14b410f6884f98183affb035a
class ComposerAutoloaderInit8da09a8f6b5e759115e893ca39030504
{
private static $loader;

Expand All @@ -22,16 +22,16 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitda89efa14b410f6884f98183affb035a', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8da09a8f6b5e759115e893ca39030504', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitda89efa14b410f6884f98183affb035a', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8da09a8f6b5e759115e893ca39030504', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitda89efa14b410f6884f98183affb035a::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8da09a8f6b5e759115e893ca39030504::getInitializer($loader));

$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInitda89efa14b410f6884f98183affb035a::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit8da09a8f6b5e759115e893ca39030504::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
Loading

0 comments on commit a848649

Please sign in to comment.