Skip to content

Commit

Permalink
Escape . in regex matches
Browse files Browse the repository at this point in the history
#ignore
  • Loading branch information
infininight committed Jul 2, 2018
1 parent b6c4f70 commit 74c295b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions DragCommands/CSS Link.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<key>command</key>
<string>#!/usr/bin/env ruby20
if ENV['TM_DROPPED_FILE'] =~ /print[^\/]*.css$/
if ENV['TM_DROPPED_FILE'] =~ /print[^\/]*\.css$/
print "&lt;link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"print\"$TM_XHTML&gt;"
elsif ENV['TM_DROPPED_FILE'] =~ /(aural|speech)[^\/]*.css$/
elsif ENV['TM_DROPPED_FILE'] =~ /(aural|speech)[^\/]*\.css$/
print "&lt;link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"speech\"$TM_XHTML&gt;"
elsif ENV['TM_DROPPED_FILE'] =~ /screen[^\/]*.css$/
elsif ENV['TM_DROPPED_FILE'] =~ /screen[^\/]*\.css$/
print "&lt;link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"screen\"$TM_XHTML&gt;"
else
print "&lt;link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\"$TM_XHTML&gt;"
Expand Down
4 changes: 2 additions & 2 deletions DragCommands/Insert Anchor href.tmDragCommand
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<key>command</key>
<string>#!/usr/bin/env ruby20

if ENV['TM_SCOPE'] =~ /string.quoted.double.html/
if ENV['TM_SCOPE'] =~ /string\.quoted\.double\.html/
print "#{ENV['TM_DROPPED_FILE']}"
elsif ENV['TM_SCOPE'] =~ /punctuation.definition.tag.end.html/
elsif ENV['TM_SCOPE'] =~ /punctuation\.definition\.tag\.end\.html/
print " href=\"#{ENV['TM_DROPPED_FILE']}\""
else
print "href=\"#{ENV['TM_DROPPED_FILE']}\" "
Expand Down

0 comments on commit 74c295b

Please sign in to comment.