Skip to content

Commit

Permalink
Fix freaky regexp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed May 4, 2024
1 parent cc786ae commit 603a9f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/rack/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def print_routes
end
puts
puts "Routes:"
puts "======="
puts "=======\n"
if routes.blank?
puts "No routes found. Have you commented all of your routes?"
puts "Documentation: https://github.com/jeremyevans/roda-route_list#basic-usage-"
Expand Down
2 changes: 1 addition & 1 deletion bridgetown-routes/lib/bridgetown-routes/code_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def eval_route_file(file, file_slug, app) # rubocop:disable Lint/UnusedMethodArg
code = ruby_content[1]
code_postmatch = ruby_content.post_match.lstrip
front_matter_line_count = code.lines.count - 1
if code.match?(%r!^\s*render_with\s|\(!).! && code.match?(%r!r\.[a-z]+\s+do!).!
if code.match?(%r!^\s*render_with(\s|\()!).! && code.match?(%r!r\.[a-z]+\s+do!).!
code.concat("\nrender_with {}")
end
end
Expand Down
1 change: 1 addition & 0 deletions bridgetown-routes/test/ssr/src/_routes/nested/[slug].erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---<%
slug_param = params[:slug]
() # test for previous regexp bug
title = "Nested Page with Slug"
%>---

Expand Down

0 comments on commit 603a9f4

Please sign in to comment.