You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/docsygen.yml
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -137,15 +137,15 @@ jobs:
137
137
# Test the sed commands manually first
138
138
echo "=== Testing sed commands ==="
139
139
echo "Test 1 - ../images/file.png:"
140
-
echo "" | sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g'
140
+
echo "" | sed 's|!\[\([^]]*\)\](\([^/]*/\)*\([^/)]*\.\(png\|jpg\|jpeg\|gif\|svg\|webp\))\)||g'
141
141
echo "Test 2 - /images/file.png:"
142
-
echo "" | sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g'
142
+
echo "" | sed 's|!\[\([^]]*\)\](\([^/]*/\)*\([^/)]*\.\(png\|jpg\|jpeg\|gif\|svg\|webp\))\)||g'
143
143
echo "Test 3 - ./images/file.png:"
144
-
echo "" | sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g'
144
+
echo "" | sed 's|!\[\([^]]*\)\](\([^/]*/\)*\([^/)]*\.\(png\|jpg\|jpeg\|gif\|svg\|webp\))\)||g'
145
145
echo "Test 4 - YAML image property:"
146
-
echo "image: ../images/ErrorModelWithBoth.png" | sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g'
146
+
echo "image: ../images/ErrorModelWithBoth.png" | sed 's|image: \([^/]*/\)*\([^/]*\.\(png\|jpg\|jpeg\|gif\|svg\|webp\)\)|image: ./images/\2|g'
147
147
echo "Test 5 - Complex path:"
148
-
echo "" | sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g'
148
+
echo "" | sed 's|!\[\([^]]*\)\](\([^/]*/\)*\([^/)]*\.\(png\|jpg\|jpeg\|gif\|svg\|webp\))\)||g'
149
149
150
150
# Process content step by step using temp files
151
151
echo "=== Step 1 - Original content ==="
@@ -156,8 +156,9 @@ jobs:
156
156
grep "images/" "$slidev_dir/step2.md" || echo "No images found"
157
157
158
158
# Normalize all image paths to ./images/filename since we copied all images there
159
-
# This handles: ../images/file.png, ./images/file.png, /images/file.png, images/file.png
160
-
sed -E 's|!\[([^\]]*)\]\(([^/]*/)*(([^/)]+\.(png|jpg|jpeg|gif|svg|webp)))\)||g; s|(image:[[:space:]]*)([^/]*/)*(([^/[:space:]]+\.(png|jpg|jpeg|gif|svg|webp)))|\1./images/\4|g' "$slidev_dir/step2.md" > "$slidev_dir/step3.md"
0 commit comments