Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed english text from link_to helper. #736

Merged
merged 3 commits into from Nov 28, 2015
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/nanoc/helpers/link_to.rb
Expand Up @@ -82,14 +82,14 @@ def link_to(text, target, attributes = {})
# @example Linking to the same page
#
# link_to_unless_current('This Item', @item)
# # => '<span class="active" title="You\'re here.">This Item</span>'
# # => '<span class="active">This Item</span>'
def link_to_unless_current(text, target, attributes = {})
# Find path
path = target.is_a?(String) ? target : target.path

if @item_rep && @item_rep.path == path
# Create message
"<span class=\"active\" title=\"You're here.\">#{text}</span>"
"<span class=\"active\">#{text}</span>"
else
link_to(text, target, attributes)
end
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/test_link_to.rb
Expand Up @@ -67,7 +67,7 @@ def test_link_to_unless_current_current

# Check
assert_equal(
'<span class="active" title="You\'re here.">Bar</span>',
'<span class="active">Bar</span>',
link_to_unless_current('Bar', @item_rep),
)
ensure
Expand Down