Browse files

fix issue with link reference rewriting when hidden links are present

  • Loading branch information...
1 parent cc2edec commit a2c4047721e0348af3e8f29fbd95a1dcaa601a71 @micha committed Oct 10, 2010
Showing with 5 additions and 1 deletion.
  1. +4 −0 .gitignore
  2. +1 −1 resty
View
4 .gitignore
@@ -0,0 +1,4 @@
+*.swp
+*.swo
+*~
+.DS_Store
View
2 resty
@@ -69,7 +69,7 @@ function resty() {
echo "$err" | grep -qi '^< \s*Content-Type: *text/html' \
&& [ -z "$raw" ] && d=$h2t || d=cat
[ -n "$out" ] && out=$(echo "$out" |eval "$d")
- [ "$d" = "$h2t" ] && out=$(echo "$out" |perl -e "\$host='$(echo "$_resty_host" |sed 's/^\(https*:\/\/[^\/*]*\).*$/\1/')';" -e '@a=<>; $s=0; foreach (reverse(@a)) { if ($_ =~ /^$/) { $s++; } unless ($s>0) { s/^\s+[0-9]+\. //; s/^file:\/\/localhost/$host/; } push(@ret,$_); } print(join("",reverse(@ret)))')
+ [ "$d" = "$h2t" ] && out=$(echo "$out" |perl -e "\$host='$(echo "$_resty_host" |sed 's/^\(https*:\/\/[^\/*]*\).*$/\1/')';" -e '@a=<>; $s=0; foreach (reverse(@a)) { if ($_ =~ /^References$/) { $s++; } unless ($s>0) { s/^\s+[0-9]+\. //; s/^file:\/\/localhost/$host/; } push(@ret,$_); } print(join("",reverse(@ret)))')
if [ "$ret" != "2" ]; then
[ -n "$out" ] && echo "$out" 1>&2
return $ret

0 comments on commit a2c4047

Please sign in to comment.