mirror of https://github.com/captn3m0/muse-dl
Fix filenames with double-quotes
parent
4a358d0cb0
commit
ff225b12c6
|
@ -0,0 +1,9 @@
|
|||
require "../src/util"
|
||||
require "./spec_helper"
|
||||
|
||||
describe Muse::Dl::Util do
|
||||
it "should sanitize filenames properly" do
|
||||
fn = Muse::Dl::Util.slug_filename("Hello world - \" :A$3, a story; a poem|chapter")
|
||||
fn.should eq "Hello world - - -A-3, a story- a poem-chapter"
|
||||
end
|
||||
end
|
|
@ -2,7 +2,7 @@ module Muse::Dl
|
|||
class Util
|
||||
# Generates a safe filename
|
||||
def self.slug_filename(input : String)
|
||||
input.strip.tr("\u{202E}%$|:;/\t\r\n\\", "-")
|
||||
input.strip.tr("\u{202E}%$|:;/\"\t\r\n\\", "-")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue