Skip to content

Commit 01ca022

Browse files
committed
Restore _escaped function to using URI::PATTERN::RESERVED
This ensures that the issue with colons in page links (like on the Ruby site) still works, though it possibly breaks non-ASCII page names.
1 parent 94e3083 commit 01ca022

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To server sites from another locale (say, "es" or Spanish)...
4040

4141
The server listens on `0.0.0.0:9292`.
4242

43-
Now you have to setup subdomain for the site. If you have Pow, run:
43+
Now you have to set up subdomain mappings for the site. If you have Pow, run:
4444

4545
$ echo 9292 > ~/.pow/railsbridge # works for any subdomain
4646

app.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class InstallFest < Sinatra::Application # todo: use Sinatra::Base instead, wi
2929
AVAILABLE_LOCALES = %w(en es)
3030

3131
configure do
32-
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
32+
I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
3333
I18n.load_path = Dir[File.join(settings.root, 'locales', '*.yml')]
3434
I18n.backend.load_translations
3535

lib/doc_page.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def body_content
124124
# Encode page name and fragment name separately so that
125125
# the fragment indicator '#' won't be escaped.
126126
page_name, fragment = @back.split('#')
127-
back_url = [URI.escape(page_name), URI.escape(fragment)].join('#')
127+
url_components = [URI.escape(page_name, URI::PATTERN::RESERVED)]
128+
url_components << URI.escape(fragment, URI::PATTERN::RESERVED) if fragment
129+
back_url = url_components.join('#')
128130

129131
div.back {
130132
text I18n.t("general.back_to") + " "

lib/step.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def link_without_toc name
107107
end
108108

109109
def _escaped str
110-
URI.escape(str)
110+
URI.escape(str, URI::PATTERN::RESERVED)
111111
end
112112

113113
def simple_link name, options={}

0 commit comments

Comments
 (0)