Skip to content
Browse files

Updated to work with image upload command, still removes temp images …

…from output, but leaves uploaded images.
  • Loading branch information...
1 parent 84d8871 commit 1cb05ac1efc6d5d3236db78ac35bda8cd07fd42e @ttscoff committed Jan 14, 2011
View
2 Commands/Copy for Posting (Autofill).tmCommand
@@ -77,7 +77,7 @@ html = html.gsub(/^<\d+> .*$/,'').gsub(/<\d+>/,'')
if !(ENV['TM_SCOPE'].scan(/markdown/).empty?)
html = %x{echo #{e_sh html}|"#{ENV['TM_SUPPORT_PATH']}/bin/Markdown.pl"}
end
-html.gsub!(/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img[^>]+>(<\/p>)?(<\/div>)?/,'')
+html.gsub!(/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img class="removeme"[^>]+>(<\/p>)?(<\/div>)?/,'')
# remove common unicode punctuation
html.gsub!(/…/,'...')
View
6 Commands/Copy for Posting.tmCommand
@@ -12,12 +12,12 @@
s/^<\d+> .*$//g;
s/<\d+>//g;
if($img = /(<img[^>]+>)/) {
- s/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img[^>]+>(<\/p>)?(<\/div>)?//g;
+ s/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img class="removeme"[^>]+>(<\/p>)?(<\/div>)?//g;
}'|"$TM_BUNDLE_SUPPORT/lib/MultiMarkdown.pl"`
else
bodytext=`cat $STDIN|perl -pe '
- if($img = /(<img[^>]+>)/) {
- s/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img[^>]+>(<\/p>)?(<\/div>)?(\s+)?//g;
+ if($img = /(<img class="removeme"[^>]+>)/) {
+ s/(<div class="removeme"[^>]+>)?(.*)?(<p([^>]+)?>(.*)?)?<img class="removeme"[^>]+>(<\/p>)?(<\/div>)?(\s+)?//g;
}'`
fi
bodytext=`echo "$bodytext"|sed s/[“”]/\"/g|sed s/[‘’]/\'/g|sed s/…/\ ...\ /g|sed s/–/-/g|sed s/—/\ --\ /g`
View
2 DragCommands/Insert Temp Image.tmDragCommand
@@ -8,7 +8,7 @@
<string>img="$TM_DROPPED_FILE"
imagewidth=`sips -g pixelWidth "$img"|awk '/pixelWidth/ { printf("%d",$2) }'`
[[ $imagewidth -gt 299 ]] &amp;&amp; echo -n "&lt;div class=\"removeme\" style=\"text-align: center;\"&gt;"
-echo -n "&lt;img src=\"file:`pwd`/$img\" "
+echo -n "&lt;img class=\"removeme\" src=\"file:`pwd`/$img\" "
sips -g pixelWidth -g pixelHeight "$img" \
|awk '/pixelWidth/ { printf("width=\"%d\" ", $2) }

0 comments on commit 1cb05ac

Please sign in to comment.
Something went wrong with that request. Please try again.