Parcourir la source

since unquoted strings are getting quoted with single quotes treat them the same

ruduki2 il y a 5 ans
Parent
commit
56571d09c9
1 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 2 3
      Rakefile

+ 2 - 3
Rakefile

@@ -170,9 +170,8 @@ task :autofix do
             text = "\"#{text}\""
           elsif link =~ /\A[\[\]'"\\]*\z/
             text.gsub!(/(?<!\\)'/) { "\\'" }
-            text.gsub!(/(?<!\\)"/) { "\\\"" }
-            text.gsub!(/(?<!\\)\\(?!['"])/) { "\\\\" }
-            text = "'" + (text.gsub("'") { "\\'" }) + "'"
+            text.gsub!(/(?<!\\)\\(?!')/) { "\\\\" }
+            text = "'" + text + "'"
           end
           "[[#{text}->#{dest}]#{link_mods}]"
         else