readmd.md update2

This commit is contained in:
Hamidreza 2025-04-30 08:27:07 +03:30
parent 8b324bc2b6
commit a048c2f5d7
2 changed files with 40 additions and 24 deletions

View File

@ -89,34 +89,49 @@ jobs:
# Process HTML img tags separately - preserving all attributes # Process HTML img tags separately - preserving all attributes
echo "Processing HTML image references..." echo "Processing HTML image references..."
# Use a more robust method to process HTML img tags # Use a more reliable approach with temporary files and simpler perl commands
# Create a temporary file for processing
temp_file=$(mktemp) temp_file=$(mktemp)
echo "$content" > "$temp_file" echo "$content" > "$temp_file"
# Process each img tag properly with perl # Create a simpler perl script file instead of inline perl
perl -i -0777 -pe ' perl_script=$(mktemp)
while (s/(<img\s+[^>]*?src=")([^"]+)("[^>]*?>)/) { # Write the perl script with proper escaping for YAML
my $prefix = $1; cat > "$perl_script" << 'PERLSCRIPT'
my $src = $2; #!/usr/bin/perl
my $suffix = $3; use strict;
use warnings;
# Skip URLs
if ($src =~ /^http/) { my $content = do { local $/; <STDIN> };
# Do nothing, keep as is
} else { # Process HTML img tags
# Path to be replaced while ($content =~ m|(<img\s+[^>]*?src=")([^"]+)("[^>]*?>)|g) {
my $filename = $src; my $prefix = $1;
$filename =~ s/.*\///; # Extract filename my $src = $2;
my $new_path = "images/" . $filename; my $suffix = $3;
$_ = $` . $prefix . $new_path . $suffix . $`; my $tag = $prefix . $src . $suffix;
}
} # Skip URLs
' "$temp_file" next if $src =~ /^http/;
# Get just the filename
my $filename = $src;
$filename =~ s/.*\///;
my $new_path = "images/" . $filename;
# Replace in content
my $new_tag = $prefix . $new_path . $suffix;
$content =~ s/\Q$tag\E/$new_tag/g;
}
print $content;
PERLSCRIPT
# Read back the processed content # Process content with the perl script
content=$(cat "$temp_file") cat "$temp_file" | perl "$perl_script" > "${temp_file}.new"
rm "$temp_file" # Clean up content=$(cat "${temp_file}.new")
# Clean up temporary files
rm "$temp_file" "${temp_file}.new" "$perl_script"
# Now copy all the images referenced in HTML tags # Now copy all the images referenced in HTML tags
for img_src in $(grep -o '<img [^>]*src="[^"]*"' "./$rel_path" | sed -E 's/.*src="([^"]*)".*/\1/'); do for img_src in $(grep -o '<img [^>]*src="[^"]*"' "./$rel_path" | sed -E 's/.*src="([^"]*)".*/\1/'); do

View File

@ -13,6 +13,7 @@ This benchmark compares the performance of phasicFlow with a well-stablished com
</div> </div>
</div> </div>
<div align="center"> <div align="center">
<img src="./images/phasicFlow_snapshot.png" style="width: 400px;" /> <img src="./images/phasicFlow_snapshot.png" style="width: 400px;" />
<div align="center"> <div align="center">