We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When searching for a story by URL, such as https://lobste.rs/search?q=https%3A%2F%2Fghuntley.com%2Ffracture%2F&what=stories&order=newest, after expanding the “n results for” section, the parse tree that should be below “Search query parsed to:” is empty:
This empty parse tree is visible by default when there are no results:
For comparison, search terms that aren’t URLs (as in this search) are described in that section:
The “Search query parsed to:” section should describe how the URL was parsed from the search, too.
The search parse tree is displayed in this view:
lobsters/app/views/search/index.html.erb
Lines 53 to 62 in c7ef797
That case statement needs a when :url branch.
case
when :url
:url
lobsters/app/controllers/search_controller.rb
Line 10 in c7ef797
lobsters/app/models/search.rb
Lines 18 to 19 in c7ef797
lobsters/app/models/search_parser.rb
Line 52 in c7ef797
Line 42 in c7ef797
Lines 22 to 27 in c7ef797
.as(:url) ensures the resulting parse tree Hash will contain a :url key. See as described in Parslet’s parsing docs.
.as(:url)
Hash
as
The ERB inside the new when :url branch should represent a dt element followed by a dd element, the same as all the other branches.
dt
dd
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug description
When searching for a story by URL, such as https://lobste.rs/search?q=https%3A%2F%2Fghuntley.com%2Ffracture%2F&what=stories&order=newest, after expanding the “n results for” section, the parse tree that should be below “Search query parsed to:” is empty:
This empty parse tree is visible by default when there are no results:
For comparison, search terms that aren’t URLs (as in this search) are described in that section:
The “Search query parsed to:” section should describe how the URL was parsed from the search, too.
Implementation suggestions
The search parse tree is displayed in this view:
lobsters/app/views/search/index.html.erb
Lines 53 to 62 in c7ef797
That
case
statement needs awhen :url
branch.The chain of code that shows the parse tree should contain a
:url
key with the URL as its valuelobsters/app/controllers/search_controller.rb
Line 10 in c7ef797
lobsters/app/models/search.rb
Lines 18 to 19 in c7ef797
lobsters/app/models/search_parser.rb
Line 52 in c7ef797
lobsters/app/models/search_parser.rb
Line 42 in c7ef797
lobsters/app/models/search_parser.rb
Lines 22 to 27 in c7ef797
.as(:url)
ensures the resulting parse treeHash
will contain a:url
key. Seeas
described in Parslet’s parsing docs.The ERB inside the new
when :url
branch should represent adt
element followed by add
element, the same as all the other branches.The text was updated successfully, but these errors were encountered: