瀏覽代碼

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

ruduki2 5 年之前
父節點
當前提交
56571d09c9
共有 1 個文件被更改,包括 2 次插入3 次删除
  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