Blogger: replace special characters with hyphens in the post name#280
Blogger: replace special characters with hyphens in the post name#280jekyllbot merged 3 commits intojekyll:masterfrom soywiz:blogger-special-symbols-in-name-fix
Conversation
|
Tried (with bash-for-windows and plain windows), but failed miserably, into setting up the test environment. So no tests here. I could try on my macbook but no guarantees. Also I don't know ruby. |
| filename = "%s-%s" % | ||
| [timestamp, | ||
| CGI.escape(name.downcase).tr('+','-')] | ||
| name.downcase.tr('+/\\:\'"<>{}?%*|.','-')] |
There was a problem hiding this comment.
We might still need the CGI.escape here. I might also put this into its own method.
def sanitized_filename(timestamp, name)
return timestamp if name.nil?
"%s-%s" % [
timestamp,
CGI.escape(name.downcase.tr('+/\\:\'"<>{}?%*|.', '-'))
]
endThen remove from if name.nil? to the first end, and replace it with filename = sanitized_filename(name, timestamp) 😄
|
Fixes #277. |
|
@soywiz Do you still want to apply the changes that I asked for above? |
|
Thank you! @jekyllbot: merge +bug |
No description provided.