From 74c295bfa0f923ae970a2e1213541524dcbf1705 Mon Sep 17 00:00:00 2001 From: Michael Sheets Date: Mon, 2 Jul 2018 00:41:31 -0500 Subject: [PATCH] Escape . in regex matches #ignore --- DragCommands/CSS Link.plist | 6 +++--- DragCommands/Insert Anchor href.tmDragCommand | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DragCommands/CSS Link.plist b/DragCommands/CSS Link.plist index 8221205..223766b 100644 --- a/DragCommands/CSS Link.plist +++ b/DragCommands/CSS Link.plist @@ -5,11 +5,11 @@ command #!/usr/bin/env ruby20 -if ENV['TM_DROPPED_FILE'] =~ /print[^\/]*.css$/ +if ENV['TM_DROPPED_FILE'] =~ /print[^\/]*\.css$/ print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"print\"$TM_XHTML>" -elsif ENV['TM_DROPPED_FILE'] =~ /(aural|speech)[^\/]*.css$/ +elsif ENV['TM_DROPPED_FILE'] =~ /(aural|speech)[^\/]*\.css$/ print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"speech\"$TM_XHTML>" -elsif ENV['TM_DROPPED_FILE'] =~ /screen[^\/]*.css$/ +elsif ENV['TM_DROPPED_FILE'] =~ /screen[^\/]*\.css$/ print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"screen\"$TM_XHTML>" else print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\"$TM_XHTML>" diff --git a/DragCommands/Insert Anchor href.tmDragCommand b/DragCommands/Insert Anchor href.tmDragCommand index ed38805..631c378 100644 --- a/DragCommands/Insert Anchor href.tmDragCommand +++ b/DragCommands/Insert Anchor href.tmDragCommand @@ -5,9 +5,9 @@ command #!/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']}\" "