Browse Source

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

ruduki2 5 years ago
parent
commit
56571d09c9
1 changed files with 2 additions and 3 deletions
  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