Last active
August 29, 2015 14:19
-
-
Save yoshimov/ce0495474b933c24eaf0 to your computer and use it in GitHub Desktop.
gollum-multibyte.diff for gollum 4.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *** ./lib/gollum/helpers.rb.org Thu Feb 27 00:19:51 2014 | |
| --- ./lib/gollum/helpers.rb Thu Feb 27 00:20:35 2014 | |
| *************** | |
| *** 6,12 **** | |
| return nil if file_path.nil? | |
| last_slash = file_path.rindex("/") | |
| if last_slash | |
| ! file_path[0, last_slash] | |
| end | |
| end | |
| --- 6,12 ---- | |
| return nil if file_path.nil? | |
| last_slash = file_path.rindex("/") | |
| if last_slash | |
| ! URI.unescape(file_path[0, last_slash]) | |
| end | |
| end | |
| *************** | |
| *** 18,24 **** | |
| # File.basename is too eager to please and will return the last | |
| # component of the path even if it ends with a directory separator. | |
| ! ::File.basename(file_path) | |
| end | |
| def sanitize_empty_params(param) | |
| --- 18,24 ---- | |
| # File.basename is too eager to please and will return the last | |
| # component of the path even if it ends with a directory separator. | |
| ! URI.unescape(::File.basename(file_path)) | |
| end | |
| def sanitize_empty_params(param) | |
| *** ./lib/gollum/app.rb.org Wed Apr 22 04:19:32 2015 | |
| --- ./lib/gollum/app.rb Wed Apr 22 04:43:55 2015 | |
| *************** | |
| *** 30,36 **** | |
| # _Header => header which causes errors | |
| def to_url | |
| return nil if self.nil? | |
| ! upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar'], :force_downcase => false | |
| end | |
| end | |
| --- 30,41 ---- | |
| # _Header => header which causes errors | |
| def to_url | |
| return nil if self.nil? | |
| ! strip_html_tags. | |
| ! convert_accented_html_entities. | |
| ! convert_miscellaneous_html_entities. | |
| ! collapse. | |
| ! replace_whitespace. | |
| ! collapse("-") | |
| end | |
| end | |
| *************** | |
| *** 107,113 **** | |
| get '/' do | |
| page_dir = settings.wiki_options[:page_file_dir].to_s | |
| ! redirect clean_url(::File.join(@base_url, page_dir, wiki_new.index_page)) | |
| end | |
| # path is set to name if path is nil. | |
| --- 112,118 ---- | |
| get '/' do | |
| page_dir = settings.wiki_options[:page_file_dir].to_s | |
| ! redirect clean_url(encodeURIComponent(::File.join(@base_url, page_dir, wiki_new.index_page))) | |
| end | |
| # path is set to name if path is nil. | |
| *************** | |
| *** 392,398 **** | |
| redirect to("/history/#{@file}") | |
| else | |
| redirect to("/compare/%s/%s...%s" % [ | |
| ! @file, | |
| @versions.last, | |
| @versions.first] | |
| ) | |
| --- 397,403 ---- | |
| redirect to("/history/#{@file}") | |
| else | |
| redirect to("/compare/%s/%s...%s" % [ | |
| ! encodeURIComponent(@file), | |
| @versions.last, | |
| @versions.first] | |
| ) |
Author
ご指摘ありがとうございます。確かにおかしかったので修正しました。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yoshimov 様
こんにちは、Patchを使わせて頂いています。
当方、余りpatchに詳しくないので、見当違いでしたら申し訳ありませんが、
以下2点、typoでないか、ご確認頂けると幸いです。
(1) 37/38行目:相対pathになっていない (1/2行目は相対pathになっている)
lib/gollum
(2)44/45行目:必要のない改行が入ってしまっている
! upstream_to_url :exclude => ['_Header', '_Footer', '_Sidebar'], :force_downca
se => false