Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/doc_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'titleizer'
require 'html5_page'
require 'flags'
require 'erb'

class DocPage < Html5Page
needs :site_name, :doc_title, :doc_path, :page_name, :src, :locale
Expand Down Expand Up @@ -124,8 +125,8 @@ def body_content
# Encode page name and fragment name separately so that
# the fragment indicator '#' won't be escaped.
page_name, fragment = @back.split('#')
url_components = [URI.escape(page_name, URI::PATTERN::RESERVED)]
url_components << URI.escape(fragment, URI::PATTERN::RESERVED) if fragment
url_components = [ERB::Util.u(page_name)]
url_components << ERB::Util.u(fragment) if fragment
back_url = url_components.join('#')

div.back {
Expand Down
3 changes: 2 additions & 1 deletion lib/step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'markdown_renderer'
require 'titleizer'
require 'active_support/core_ext/string/strip'
require 'erb'

class Step < Erector::Widget
external :style, <<-CSS
Expand Down Expand Up @@ -107,7 +108,7 @@ def link_without_toc name
end

def _escaped str
URI.escape(str, URI::PATTERN::RESERVED)
ERB::Util.u(str)
end

def simple_link name, options={}
Expand Down