readmd.md update6
This commit is contained in:
parent
701baf09e6
commit
253d6fbaf7
|
@ -89,45 +89,62 @@ jobs:
|
||||||
# Process HTML img tags separately using grep and sed instead of perl
|
# Process HTML img tags separately using grep and sed instead of perl
|
||||||
echo "Processing HTML image references..."
|
echo "Processing HTML image references..."
|
||||||
|
|
||||||
# Extract all HTML img tags with their src attributes
|
# Save original content for processing
|
||||||
img_tags=$(grep -o '<img [^>]*src="[^"]*"[^>]*>' "./$rel_path" || echo "")
|
original_content="$content"
|
||||||
|
|
||||||
if [ ! -z "$img_tags" ]; then
|
# Extract all HTML img tags with their src attributes
|
||||||
# For each image tag
|
# Use a temporary file to store unique img tags since they might be multi-line
|
||||||
echo "$img_tags" | while read -r img_tag; do
|
temp_file=$(mktemp)
|
||||||
# Extract the src attribute
|
grep -o '<img[^>]*>' "./$rel_path" > "$temp_file" || echo "" > "$temp_file"
|
||||||
img_src=$(echo "$img_tag" | sed -E 's/.*src="([^"]*)".*/\1/')
|
|
||||||
|
# Process each img tag from the file
|
||||||
|
while IFS= read -r img_tag; do
|
||||||
|
# Skip if empty
|
||||||
|
if [ -z "$img_tag" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract the src attribute
|
||||||
|
img_src=$(echo "$img_tag" | sed -n 's/.*src="\([^"]*\)".*/\1/p')
|
||||||
|
|
||||||
|
# Skip if no src or if it's a URL
|
||||||
|
if [ -z "$img_src" ] || [[ $img_src == http* ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Determine the absolute path of the image
|
||||||
|
if [[ $img_src == /* ]]; then
|
||||||
|
abs_img_path="./$img_src"
|
||||||
|
else
|
||||||
|
abs_img_path="$base_dir/$img_src"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract just the filename
|
||||||
|
img_filename=$(basename "$img_src")
|
||||||
|
wiki_img_path="images/$img_filename"
|
||||||
|
|
||||||
|
# Copy the image to wiki repository if it exists
|
||||||
|
if [ -f "$abs_img_path" ]; then
|
||||||
|
echo "Copying image: $abs_img_path -> ./wiki/$wiki_img_path"
|
||||||
|
cp -v "$abs_img_path" "./wiki/$wiki_img_path" || echo "Error copying image"
|
||||||
|
|
||||||
# Skip URLs
|
# Create a new img tag with the updated src but preserving all other attributes
|
||||||
if [[ $img_src == http* ]]; then
|
new_img_tag=$(echo "$img_tag" | sed "s|src=\"$img_src\"|src=\"$wiki_img_path\"|g")
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine the absolute path of the image
|
# Escape special characters for sed replacement
|
||||||
if [[ $img_src == /* ]]; then
|
escaped_img_tag=$(echo "$img_tag" | sed 's/[\/&]/\\&/g')
|
||||||
abs_img_path="./$img_src"
|
escaped_new_img_tag=$(echo "$new_img_tag" | sed 's/[\/&]/\\&/g')
|
||||||
else
|
|
||||||
abs_img_path="$base_dir/$img_src"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract just the filename
|
# Replace the img tag in content
|
||||||
img_filename=$(basename "$img_src")
|
content=$(echo "$content" | sed "s|$escaped_img_tag|$escaped_new_img_tag|g")
|
||||||
wiki_img_path="images/$img_filename"
|
echo "Replaced HTML image tag with new src path while preserving style attributes"
|
||||||
|
else
|
||||||
# Copy the image to wiki repository if it exists
|
echo "Warning: HTML image file not found: $abs_img_path"
|
||||||
if [ -f "$abs_img_path" ]; then
|
fi
|
||||||
echo "Copying image: $abs_img_path -> ./wiki/$wiki_img_path"
|
done < "$temp_file"
|
||||||
cp -v "$abs_img_path" "./wiki/$wiki_img_path" || echo "Error copying image"
|
|
||||||
|
# Clean up temporary file
|
||||||
# Safely replace the image reference in content
|
rm "$temp_file"
|
||||||
escaped_src=$(echo "$img_src" | sed 's/[\/&]/\\&/g')
|
|
||||||
escaped_wiki_path=$(echo "$wiki_img_path" | sed 's/[\/&]/\\&/g')
|
|
||||||
content=$(echo "$content" | sed "s|src=\"$escaped_src\"|src=\"$escaped_wiki_path\"|g")
|
|
||||||
else
|
|
||||||
echo "Warning: HTML image file not found: $abs_img_path"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Debug output
|
# Debug output
|
||||||
echo "Wiki page content preview (first 100 chars): ${content:0:100}"
|
echo "Wiki page content preview (first 100 chars): ${content:0:100}"
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue