test inlining
This commit is contained in:
parent
3c21c5e2f8
commit
76cafbda3a
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
function inlineLocalStylesFromHref($inputString) {
|
function inlineLocalStylesFromHref($inputString) {
|
||||||
// Define the regular expression pattern to match <link> tags with href attribute for CSS files
|
// Define the regular expression pattern to match <link> tags with href attribute for CSS files
|
||||||
$pattern = '/<link.*?(?:href=["\']\/(.*?)["\'].*?rel=["\']stylesheet["\']|rel=["\']stylesheet["\'].*?href=["\']\/(.*?)["\']).*?>/i';
|
$pattern = '/<link.*?(?:(?:rel=["\']stylesheet["\'].*?href=["\']\/(.*?)["\'])|(?:href=["\']\/(.*?)["\'].*?rel=["\']stylesheet["\'])).*?>/i';
|
||||||
|
|
||||||
// Use preg_replace_callback to replace matched link tags with inline styles
|
// Use preg_replace_callback to replace matched link tags with inline styles
|
||||||
$outputString = preg_replace_callback($pattern, function($match) {
|
$outputString = preg_replace_callback($pattern, function($match) {
|
||||||
@ -20,6 +20,7 @@ function inlineLocalStylesFromHref($inputString) {
|
|||||||
return $outputString;
|
return $outputString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function inlineScriptFromSrc($inputString) {
|
function inlineScriptFromSrc($inputString) {
|
||||||
// Define the regular expression pattern to match <script> tags with src attribute
|
// Define the regular expression pattern to match <script> tags with src attribute
|
||||||
$pattern = '/<script.*?src=["\']\/(.*?)["\'].*?>\s*<\/script>/i';
|
$pattern = '/<script.*?src=["\']\/(.*?)["\'].*?>\s*<\/script>/i';
|
||||||
|
Loading…
Reference in New Issue
Block a user