Skip to content

Commit

Permalink
fix for trim extra missing when current page=1
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Aug 3, 2018
1 parent e7b89f2 commit ad8c311
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy/extras/trim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def pagy_link_proc_with_trim(pagy, link_extra='')
p1url = pagy_trim_url(url, "#{p_vars[:page_param]}=#{MARKER}")
p1 = %(<a href="#{p1url}" #{p_vars[:link_extra]} #{link_extra})
a, b = %(<a href="#{url}" #{p_vars[:link_extra]} #{link_extra}).split(MARKER, 2)
-> (n, text=n, extra='') { start = n == 1 ? p1 : "#{a}#{n}#{b}"
-> (n, text=n, extra='') { start = n.to_i == 1 ? p1 : "#{a}#{n}#{b}"
"#{start}#{ if n == p_prev ; ' rel="prev"'
elsif n == p_next ; ' rel="next"'
else '' end } #{extra}>#{text}</a>" }
Expand Down

0 comments on commit ad8c311

Please sign in to comment.